S.O.D.A. - Simple Object Database Access - design documentation v. (unknown).

org.odbms
Interface Query


public interface Query

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 constrain()) and upon calls to 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 descend().

execute() evaluates the entire graph against all persistent objects.

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
 Constraint constrain(Object constraint)
          adds a constraint to this node.
 Constraints constraints()
          returns a Constraints object that holds an array of all constraints on this node.
 Query descend(String fieldName)
          returns a reference to a descendant node in the query graph.
 ObjectSet execute()
          executes the Query.
 Query orderAscending()
          adds an ascending ordering criteria to this node of the query graph.
 Query orderDescending()
          adds a descending order criteria to this node of the query graph.
 

Method Detail

constrain

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:

Parameters:
constraint - the constraint to be added to this Query.
Returns:
Constraint a new Constraint for this query node or null for objects implementing the Evaluation interface.

constraints

public Constraints constraints()
returns a Constraints object that holds an array of all constraints on this node.

Returns:
Constraints on this query node.

execute

public ObjectSet execute()
executes the Query.

Returns:
ObjectSet - the result of the Query.

descend

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. The descendant Query node will be created from all possible candidate classes.

Returns:
descendant Query node

orderAscending

public Query orderAscending()
adds an ascending ordering criteria to this node of the query graph. Multiple ordering criteria will be applied in the order they were called.

Returns:
this Query object to allow the chaining of method calls.

orderDescending

public Query orderDescending()
adds a descending order criteria to this node of the query graph. Multiple ordering criteria will be applied in the order they were called.

Returns:
this Query object to allow the chaining of method calls.

S.O.D.A. - Simple Object Database Access - design documentation v. (unknown).

You can get the current version of the specification at the S.O.D.A project at Sourceforge.
Build time of the docs you are viewing: Thursday, 19.09.2002, 23:39 GMT