public class QConstraints extends QCon implements Constraints
_children, i_evaluator, i_parent| Modifier and Type | Method and Description |
|---|---|
Constraint |
contains()
sets the evaluation mode to string contains comparison.
|
Constraint |
endsWith(boolean caseSensitive)
sets the evaluation mode to string endsWith comparison.
|
Constraint |
equal()
Used in conjunction with
Constraint.smaller() or Constraint.greater() to create constraints
like "smaller or equal", "greater or equal". |
java.lang.Object |
getObject()
returns the Object the query graph was constrained with to
create this
Constraint. |
Constraint |
greater()
sets the evaluation mode to
>. |
Constraint |
identity()
sets the evaluation mode to identity comparison.
|
Constraint |
like()
sets the evaluation mode to "like" comparison.
|
Constraint |
not()
turns on not() comparison.
|
Constraint |
smaller()
sets the evaluation mode to
<. |
Constraint |
startsWith(boolean caseSensitive)
sets the evaluation mode to string startsWith comparison.
|
Constraint[] |
toArray()
returns an array of the contained
Constraint objects. |
and, byExample, canBeIndexLeaf, canLoadByIndex, childrenCount, container, evaluator, getField, hasChildren, hasJoins, hasObjectInParentPath, hasParent, id, identityID, internalSetProcessedByIndex, iterateChildren, iterateJoins, onSameFieldAs, or, parent, processedByIndex, setCandidates, setProcessedByIndex, streamLock, transaction, visitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, byExample, orpublic Constraint[] toArray()
ConstraintsConstraint objects.toArray in interface ConstraintsConstraint objects.public Constraint contains()
ConstraintPilot pilot = new Pilot("Test Pilot1", 100);container.store(pilot); ...query.constrain(Pilot.class);// All pilots with the name containing "est" will be retrievedquery.descend("name").constrain("est").contains();contains in interface Constraintcontains in class QConConstraint to allow the chaining of method calls.like() for case insensitive string comparisonpublic Constraint equal()
ConstraintConstraint.smaller() or Constraint.greater() to create constraints
like "smaller or equal", "greater or equal".
For example:query.constrain(Pilot.class);query.descend("points").constrain(101).smaller().equal();equal in interface Constraintequal in class QConConstraint to allow the chaining of method calls.public Constraint greater()
Constraint>.
For example:query.constrain(Pilot.class);query.descend("points").constrain(101).greater()greater in interface Constraintgreater in class QConConstraint to allow the chaining of method calls.public Constraint identity()
ConstraintPilot pilot = new Pilot("Test Pilot1", 100);Car car = new Car("BMW", pilot);container.store(car);// Change the name, the pilot instance stays the samepilot.setName("Test Pilot2");// create a new carcar = new Car("Ferrari", pilot);container.store(car);Query query = container.query();query.constrain(Car.class);// All cars having pilot with the same database identity// will be retrieved. As we only created Pilot object once// it should mean all car objectsquery.descend("_pilot").constrain(pilot).identity();identity in interface Constraintidentity in class QConConstraint to allow the chaining of method calls.public Constraint not()
ConstraintPilot pilot = new Pilot("Test Pilot1", 100);container.store(pilot); ...query.constrain(Pilot.class);query.descend("name").constrain("t0").endsWith(true).not();not in interface Constraintnot in class QConConstraint to allow the chaining of method calls.public Constraint like()
ConstraintPilot pilot = new Pilot("Test Pilot1", 100);container.store(pilot); ...query.constrain(Pilot.class);// All pilots with the name containing "est" will be retrievedquery.descend("name").constrain("est").like();like in interface Constraintlike in class QConConstraint to allow the chaining of method calls.public Constraint startsWith(boolean caseSensitive)
ConstraintPilot pilot = new Pilot("Test Pilot0", 100);container.store(pilot); ...query.constrain(Pilot.class);query.descend("name").constrain("Test").startsWith(true);startsWith in interface ConstraintstartsWith in class QConcaseSensitive - comparison will be case sensitive if true, case insensitive otherwiseConstraint to allow the chaining of method calls.public Constraint endsWith(boolean caseSensitive)
ConstraintPilot pilot = new Pilot("Test Pilot0", 100);container.store(pilot); ...query.constrain(Pilot.class);query.descend("name").constrain("T0").endsWith(false);endsWith in interface ConstraintendsWith in class QConcaseSensitive - comparison will be case sensitive if true, case insensitive otherwiseConstraint to allow the chaining of method calls.public Constraint smaller()
Constraint<.
For example:query.constrain(Pilot.class);query.descend("points").constrain(101).smaller()smaller in interface Constraintsmaller in class QConConstraint to allow the chaining of method calls.public java.lang.Object getObject()
ConstraintConstraint.getObject in interface ConstraintgetObject in class QCon