com.holonplatform.core.query

## Interface QueryProjection<T>

- Type Parameters:
    `T` - Projection result type
  All Superinterfaces:
    Expression, TypedExpression<T>
  All Known Subinterfaces:
    BeanProjection<T>, BeanProperty<T>, BeanProperty.Builder<T>, BooleanBeanProperty, BooleanProperty, BooleanProperty.BooleanPropertyBuilder, CollectionPathProperty<E,C>, ConstantExpression<T>, CountAllProjection, ListPathProperty<T>, ListPathProperty.ListPathPropertyBuilder<T>, NumericBeanProperty<N>, NumericProperty<N>, NumericProperty.NumericPropertyBuilder<N>, PathExpression<T>, PathProperty<T>, PathProperty.PathPropertyBuilder<T>, PropertyBoxProperty, PropertyBoxProperty.PropertyBoxPropertyBuilder, PropertySetProjection, QueryFunction<T,A>, QueryFunction.Avg, QueryFunction.Count, QueryFunction.Max<T>, QueryFunction.Min<T>, QueryFunction.NoArgQueryFunction<T>, QueryFunction.PropertyQueryFunction<T,A>, QueryFunction.Sum<T>, SelectAllProjection, SetPathProperty<T>, SetPathProperty.SetPathPropertyBuilder<T>, StringBeanProperty, StringFunction, StringFunction.Lower, StringFunction.Upper, StringProperty, StringProperty.StringPropertyBuilder, TemporalBeanProperty<T>, TemporalFunction<T>, TemporalFunction.CurrentDate, TemporalFunction.CurrentLocalDate, TemporalFunction.CurrentLocalDateTime, TemporalFunction.CurrentTimestamp, TemporalFunction.Day, TemporalFunction.Hour, TemporalFunction.Month, TemporalFunction.Year, TemporalProperty<T>, TemporalProperty.TemporalPropertyBuilder<T>

      public interface QueryProjection<T>
      extends TypedExpression<T>

  A query projection `Expression` to obtain typed query results.
  Since:
    5.0.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> QueryProjection<T>` | `bean(Class<? extends T> beanClass, Path<?>... selection)` Create a `QueryProjection` using given bean class.
    `static <T> QueryProjection<T>` | `constant(T value)` Create a `QueryProjection` for a constant value.
    `static QueryProjection<Long>` | `countAll()` Create a query projection to count all the query results.
    `static <T> QueryProjection<T>` | `path(Path<T> path)` Create a `QueryProjection` for a `Path` expression.
    `static <P extends Property> QueryProjection<PropertyBox>` | `propertySet(Iterable<P> properties)` Create a `PropertyBox` type query projection using given `properties` as property set.
    `static QueryProjection<PropertyBox>` | `propertySet(Property<?>... properties)` Create a `PropertyBox` type query projection using given `properties` as property set.

    - ### Methods inherited from interface com.holonplatform.core.TypedExpression

      `getTemporalType, getType, isCollectionExpression, isConverterExpression`

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### constant

          static <T> QueryProjection<T> constant(T value)

      Create a `QueryProjection` for a constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `value` - Constant value
      Returns:
        A new constant expression projection

    - #### path

          static <T> QueryProjection<T> path(Path<T> path)

      Create a `QueryProjection` for a `Path` expression.
      Type Parameters:
        `T` - Path type
      Parameters:
        `path` - The `Path` expression (not null)
      Returns:
        A new path expression projection

    - #### propertySet

          static QueryProjection<PropertyBox> propertySet(Property<?>... properties)

      Create a `PropertyBox` type query projection using given `properties` as property set.
      Parameters:
        `properties` - The projection property set (not null)
      Returns:
        A new query projection using given `properties` as property set

    - #### propertySet

          static <P extends Property> QueryProjection<PropertyBox> propertySet(Iterable<P> properties)

      Create a `PropertyBox` type query projection using given `properties` as property set.
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - The projection property set (not null)
      Returns:
        A new query projection using given `properties` as property set

    - #### bean

          static <T> QueryProjection<T> bean(Class<? extends T> beanClass,
                                             Path<?>... selection)

      Create a `QueryProjection` using given bean class.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - The bean class (not null)
        `selection` - Optional selection paths. If not provided, all valid bean property paths will be used.
      Returns:
        A new bean projection

    - #### countAll

          static QueryProjection<Long> countAll()

      Create a query projection to count all the query results.
      Returns:
        A new count all query projection of `Long` type

Copyright © 2019 The Holon Platform. All rights reserved.