public interface GetScalar<E,R> extends Command<R>
GetScalar is a command interface to get the scalar value as the
result for aggregating of entity list matches to the specified
Filters and sorted by the specified sort orders.
This command's execution result is the returned value of the specified
Aggregation instance's Aggregation#aggregate(java.util.List)
method.
You can build & execute this command as the following code, in App
Engine:
import org.eiichiro.acidhouse.Session;
import org.eiichiro.acidhouse.appengine.AppEngineDatastoreSession;
...
// Create 'Session' instance.
Session session = new AppEngineDatastoreSession();
// Get metamodel instance of 'Entity3' class.
Entity3$ entity3$ = Metamodels.metamodel(Entity3.class);
// Get summary of 'i' field of the 'Entity3' entities which their 'i' field
// is less than 5.
int sum = session
.get(Aggregations.sum(entity3$.i))
.filter(entity3$.i.lessThan(5))
.execute();
Aggregation,
Aggregations| Modifier and Type | Method and Description |
|---|---|
GetScalar<E,R> |
filter(Filter<?>... filters)
Qualifies entities to be retrieved with the specified
Filters. |
GetScalar<E,R> |
sort(Order<?,?>... orders)
Specifies sort orders by which the list passed to
Aggregation#aggregate(java.util.List) method is sorted. |
GetScalar<E,R> sort(Order<?,?>... orders)
Aggregation#aggregate(java.util.List) method is sorted.orders - The sort orders by which the returned list is sorted.GetScalar which the execution result passed to
Aggregation#aggregate(java.util.List) is sorted
by the specified sort orders.GetScalar<E,R> filter(Filter<?>... filters)
Filters.
Each of the specified filters is combined with "logical and".filters - Filters to qualify the retrieved entities.GetScalar which the execution result passed to
Aggregation#aggregate(java.util.List) is qualified by the
specified filters.Copyright © 2009-2014 Eiichiro Uchiumi. All Rights Reserved.