public class ComparableProperty<E,T extends Comparable<T>> extends Property<E,T>
ComparableProperty is a Property extension represents a
comparable property.
You can get several ComparableFilter instances from this class, and
then pass them to command's #filter(Filter...) methods, like this:
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);
// Qualify entities which their 'entity1.i' proerty is greater than or equal
// to 13, and 15 or 16.
List<Entity3> entity3s = session
.get(Entity3.class)
.filter(entity3_.entity1.i.greaterThanOrEqualTo(13),
entity3_.entity1.i.in(15, 16))
.execute();
And sorting order. Like this:
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 all 'Entity3' entities sorted by 'entity1.i' property in descending
// order and 'i' property in descending order.
List<Entity3> entity3s = session.get(Entity3.class)
.sort(entity3_.entity1.i.desc, entity3_.i.asc)
.execute();
| Modifier and Type | Field and Description |
|---|---|
Order<E,T> |
asc
Sorting order: ascending direction.
|
Order<E,T> |
desc
Sorting order: descending direction.
|
| Constructor and Description |
|---|
ComparableProperty(Metamodel<E> metamodel,
Type type,
String name)
Constructs a new
ComparableProperty instance with the specified
Metamodel instance which has this metamodel property, property
type and property name. |
ComparableProperty(Property<E,?> parent,
Type type,
String name)
Constructs a new
ComparableProperty instance with the specified
Property instance which has this metamodel property, property
type and property name. |
| Modifier and Type | Method and Description |
|---|---|
Filter<T> |
equalTo(T value)
Creates a
Filter to indicate whether this property is equal to
the specified value or not (==). |
Filter<T> |
greaterThan(T value)
Creates a
Filter to indicate whether this property is greater
than the specified value or not (>). |
Filter<T> |
greaterThanOrEqualTo(T value)
Creates a
Filter to indicate whether this property is greater
than or equal to the specified value or not (>=). |
Filter<T> |
in(T... values)
Creates a
Filter to indicate whether this property is contained
in the specified value or not (IN(...)). |
Filter<T> |
lessThan(T value)
Creates a
Filter to indicate whether this property is less than
the specified value or not (<). |
Filter<T> |
lessThanOrEqualTo(T value)
Creates a
Filter to indicate whether this property is less than
or equal to the specified value or not (<=). |
Filter<T> |
notEqualTo(T value)
Creates a
Filter to indicate whether this property is not equal
to the specified value or not (!=, <>). |
public final Order<E,T extends Comparable<T>> desc
public final Order<E,T extends Comparable<T>> asc
public ComparableProperty(Metamodel<E> metamodel, Type type, String name)
ComparableProperty instance with the specified
Metamodel instance which has this metamodel property, property
type and property name.metamodel - The Metamodel instance which has this metamodel
property.type - The property type.name - The property name.public ComparableProperty(Property<E,?> parent, Type type, String name)
ComparableProperty instance with the specified
Property instance which has this metamodel property, property
type and property name.parent - The parent Property instance which has this metamodel
property.type - The property type.name - The property name.public Filter<T> equalTo(T value)
Filter to indicate whether this property is equal to
the specified value or not (==).value - The value to be evaluated.Filter to indicate whether this property is equal to
the specified value or not.public Filter<T> notEqualTo(T value)
Filter to indicate whether this property is not equal
to the specified value or not (!=, <>).value - The value to be evaluated.Filter to indicate whether this property is not equal
to the specified value or not.public Filter<T> greaterThan(T value)
Filter to indicate whether this property is greater
than the specified value or not (>).value - The value to be evaluated.Filter to indicate whether this property is greater
than the specified value or not.public Filter<T> greaterThanOrEqualTo(T value)
Filter to indicate whether this property is greater
than or equal to the specified value or not (>=).value - The value to be evaluated.Filter to indicate whether this property is greater
than or equal to the specified value or not.public Filter<T> lessThan(T value)
Filter to indicate whether this property is less than
the specified value or not (<).value - The value to be evaluated.Filter to indicate whether this property is less than
the specified value or not.public Filter<T> lessThanOrEqualTo(T value)
Filter to indicate whether this property is less than
or equal to the specified value or not (<=).value - The value to be evaluated.Filter to indicate whether this property is less than
or equal to the specified value or not.Copyright © 2009-2014 Eiichiro Uchiumi. All Rights Reserved.