|
db4o 7.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Query
handle to a node in a S.O.D.A. 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(java.lang.Object)) and upon calls to descend(java.lang.String) that request nodes that do not yet exist.
References to joined nodes in the query graph can be obtained
by "walking" along the nodes of the graph with the method
descend(java.lang.String).
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.
Note:
Native queries are the recommended main query
interface of db4o.
| Method Summary | ||
|---|---|---|
Constraint |
constrain(java.lang.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(java.lang.String fieldName)
returns a reference to a descendant node in the query graph. |
|
|
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. |
|
Query |
sortBy(java.util.Comparator comparator)
Sort the resulting ObjectSet by the given comparator. |
|
Query |
sortBy(QueryComparator<?> comparator)
Sort the resulting ObjectSet by the given comparator. |
|
| Method Detail |
|---|
Constraint constrain(java.lang.Object constraint)
Class: confine the result to objects of one
class or to objects implementing an interface.Evaluation: run
evaluation callbacks against all candidates.
constraint - the constraint to be added to this Query.
Constraint a new Constraint for this
query node or null for objects implementing the
Evaluation interface.Constraints constraints()
Constraints
object that holds an array of all constraints on this node.
Constraints on this query node.Query descend(java.lang.String fieldName)
fieldName - path to the descendant.
Query node<T> ObjectSet<T> execute()
Query.
ObjectSet - the result of the Query.Query orderAscending()
If multiple ordering criteria are applied, the chronological order of method calls is relevant: criteria created by 'earlier' calls are considered more significant, i.e. 'later' criteria only have an effect for elements that are considered equal by all 'earlier' criteria.
As an example, consider a type with two int fields, and an instance set {(a:1,b:3),(a:2,b:2),(a:1,b:2),(a:2,b:3)}. The call sequence [orderAscending(a), orderDescending(b)] will result in [(a:1,b:3),(a:1,b:2),(a:2,b:3),(a:2,b:2)].
Query object to allow the chaining of method calls.Query orderDescending()
orderAscending().
Query object to allow the chaining of method calls.Query sortBy(QueryComparator<?> comparator)
comparator - The comparator to apply.
Query object to allow the chaining of method calls.Query sortBy(java.util.Comparator comparator)
comparator - The comparator to apply.
Query object to allow the chaining of method calls.
|
db4o 7.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||