Class QueryModel.PropertyProjection

java.lang.Object
io.micronaut.data.model.query.QueryModel.Projection
io.micronaut.data.model.query.QueryModel.PropertyProjection
Direct Known Subclasses:
QueryModel.AvgProjection, QueryModel.CountDistinctProjection, QueryModel.GroupPropertyProjection, QueryModel.MaxProjection, QueryModel.MinProjection, QueryModel.SumProjection
Enclosing interface:
QueryModel

public static class QueryModel.PropertyProjection extends QueryModel.Projection
A projection that obtains the value of a property of an entity.
  • Constructor Details

    • PropertyProjection

      public PropertyProjection(String propertyName)
      Default constructor.
      Parameters:
      propertyName - The property name
    • PropertyProjection

      public PropertyProjection(String propertyName, boolean compound)
      Default constructor.
      Parameters:
      propertyName - The property name
      compound - Is compound property
  • Method Details

    • getPropertyName

      public String getPropertyName()
      Returns:
      The property name
    • aliased

      Include an alias that is the same as the property name.
      Returns:
      This property
    • setAlias

      public void setAlias(String alias)
      Sets the alias.
      Parameters:
      alias - the alias
    • getAlias

      public Optional<String> getAlias()
      Returns:
      The alias to use for the projection.
    • isCompound

      public boolean isCompound()
      Returns:
      True if it's compound property