| com.mobixess.jodb.soda.api.Query
All known Subclasses: com.mobixess.jodb.core.query.QueryNode,
Query | public interface Query (Code) | | handle to a node in the query graph.
A node in the query graph can represent multiple
classes, one class or an attribute of a class.
The graph
is automatically extended with attributes of added constraints
(see
Query.constrain constrain() )
and upon calls to
Query.descend(java.lang.String) descend() that request nodes that do not yet exist.
References to joined nodes in the query graph kann be obtained
by "walking" along the nodes of the graph with the method
Query.descend(java.lang.String) descend() .
Query.execute() evaluates the entire graph against all persistent objects.
Query.execute() can be called from any
Query node
of the graph. It will return an
ObjectSet filled with
objects of the class/classes that the node, it was called from,
represents.
|
Method Summary | |
public Constraint | constrain(Object constraint) adds a constraint to this node.
If the constraint contains attributes that are not yet
present in the query graph, the query graph is extended
accordingly.
Special behaviour for:
- class
Class : confine the result to objects of one
class (if the
Class object represents a class)
or to objects implementing a specific interface
(if the
Class object represents an interface).
- interface
Evaluation : run
evaluation callbacks against all candidates.
Parameters: constraint - the constraint to be added to this Query. | public Constraints | constraints() returns a
Constraints object that holds an array of all constraints on this node. | public Query | descend(String fieldName) returns a reference to a descendant node in the query graph.
If the node does not exist, it will be created.
All classes represented in the query node are tested, whether
they contain a field with the specified field name. | public ObjectSet | execute() executes the
Query . | public Query | orderAscending() adds an ascending ordering criteria to this node of
the query graph. | public Query | orderDescending() adds a descending order criteria to this node of
the query graph. |
constrain | public Constraint constrain(Object constraint)(Code) | | adds a constraint to this node.
If the constraint contains attributes that are not yet
present in the query graph, the query graph is extended
accordingly.
Special behaviour for:
- class
Class : confine the result to objects of one
class (if the
Class object represents a class)
or to objects implementing a specific interface
(if the
Class object represents an interface).
- interface
Evaluation : run
evaluation callbacks against all candidates.
Parameters: constraint - the constraint to be added to this Query. Constraint a new Constraint for thisquery node or null for objects implementing the Evaluation interface. |
descend | public Query descend(String fieldName)(Code) | | returns a reference to a descendant node in the query graph.
If the node does not exist, it will be created.
All classes represented in the query node are tested, whether
they contain a field with the specified field name. The
descendant Query node will be created from all possible candidate
classes.
Parameters: field - path to the descendant. descendant Query node |
orderAscending | public Query orderAscending()(Code) | | adds an ascending ordering criteria to this node of
the query graph. Multiple ordering criteria will be applied
in the order they were called.
this Query object to allow the chaining of method calls. |
orderDescending | public Query orderDescending()(Code) | | adds a descending order criteria to this node of
the query graph. Multiple ordering criteria will be applied
in the order they were called.
this Query object to allow the chaining of method calls. |
|
|