Class Projections
java.lang.Object
io.micronaut.data.model.query.factory.Projections
Projections used to customize the results of a query.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final QueryModel.CountProjection
static final QueryModel.IdProjection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryModel.AvgProjection
Computes the average value of a property.static QueryModel.CountProjection
count()
Projection that returns the number of records from the query.countDistinct
(String property) Projection that signifies to return only distinct results.Projection that signifies to return only distinct results against an entity, meaning its identity property/properties.distinct()
Projection that signifies to return only distinct results.groupProperty
(String property) Defines a group by projection for datastores that support it.static QueryModel.IdProjection
id()
Projection used to obtain the id of an object.static QueryModel.LiteralProjection
A projection that projects a simple literal.static QueryModel.MaxProjection
Computes the pageSize value of a property.static QueryModel.MinProjection
Computes the min value of a property.A projection that obtains the value of a property of an entity.A projection that obtains the value of a property of an entity.Defines a projection of the root entity.static QueryModel.SumProjection
Computes the sum of a property.
-
Field Details
-
ID_PROJECTION
-
COUNT_PROJECTION
-
-
Constructor Details
-
Projections
public Projections()
-
-
Method Details
-
id
Projection used to obtain the id of an object.- Returns:
- The IdProjection instance
-
count
Projection that returns the number of records from the query. instead of the results themselves- Returns:
- The CountProjection instance
-
literal
A projection that projects a simple literal.- Parameters:
value
- The literal value- Returns:
- The LiteralProjection instance
-
property
A projection that obtains the value of a property of an entity.- Parameters:
name
- The name of the property- Returns:
- The PropertyProjection instance
-
property
A projection that obtains the value of a property of an entity.- Parameters:
name
- The name of the propertycompound
- Is compound- Returns:
- The PropertyProjection instance
- Since:
- 4.2.0
-
sum
Computes the sum of a property.- Parameters:
name
- The name of the property- Returns:
- The PropertyProjection instance
-
min
Computes the min value of a property.- Parameters:
name
- The name of the property- Returns:
- The PropertyProjection instance
-
max
Computes the pageSize value of a property.- Parameters:
name
- The name of the property- Returns:
- The PropertyProjection instance
-
avg
Computes the average value of a property.- Parameters:
name
- The name of the property- Returns:
- The PropertyProjection instance
-
distinct
Projection that signifies to return only distinct results.- Returns:
- Distinct projection
-
countDistinct
Projection that signifies to return only distinct results.- Parameters:
property
- The name of the property- Returns:
- Distinct projection
-
countDistinctRoot
Projection that signifies to return only distinct results against an entity, meaning its identity property/properties.- Returns:
- count distinct projection for the entity
-
groupProperty
Defines a group by projection for datastores that support it.- Parameters:
property
- The property name- Returns:
- The projection list
-
rootEntity
Defines a projection of the root entity.- Returns:
- The projection
-