public abstract class Aggregations extends Object
Aggregations has some factory methods to provide useful
Aggregation instances.
You can get popular aggregations by using this class. For example:
import org.eiichiro.acidhouse.Aggregations;
import org.eiichiro.acidhouse.Session;
import org.eiichiro.acidhouse.metamodel.Metamodels;
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 max value of "Entity3"'s 'i' property from 'Entity3' instances which
// their 'i' property value is less than 5.
int max = session
.get(Aggregations.max(entity3_.i))
.filter(entity3_.i.lessThan(5))
.execute();
Better to static-import this class.Aggregation| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<T>> |
max(Property<?,T> property)
Get the max aggregation implementation for the specified property.
|
static <T extends Comparable<T>> |
min(Property<?,T> property)
Get the min aggregation implementation for the specified property.
|
static <T extends Number & Comparable<T>> |
sum(Property<?,T> property)
Get the sum aggregation implementation for the specified property.
|
public static <T extends Comparable<T>> Aggregation<T> max(Property<?,T> property)
T - The property value type that this max aggregation aggregates.property - The metamodel property that this max aggregation
aggregates.public static <T extends Comparable<T>> Aggregation<T> min(Property<?,T> property)
T - The property value type that this min aggregation aggregates.property - The metamodel property that this min aggregation
aggregates.public static <T extends Number & Comparable<T>> Aggregation<T> sum(Property<?,T> property)
T - The property value type that this sum aggregation aggregates.property - The metamodel property that this sum aggregation
aggregates.Copyright © 2009-2014 Eiichiro Uchiumi. All Rights Reserved.