01: /*
02: * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
03: */
04: package javax.jcr.query.qom;
05:
06: import javax.jcr.query.PreparedQuery;
07:
08: /**
09: * A query in the JCR query object model.
10: * <p/>
11: * The JCR query object model describes the queries that can be evaluated
12: * by a JCR repository independent of any particular query language, such
13: * as SQL.
14: * <p/>
15: * A query consists of:
16: * <ul>
17: * <li>a source. When the query is evaluated, the source evaluates its
18: * selectors and the joins between them to produce a (possibly empty)
19: * set of node-tuples. This is a set of 1-tuples if the query has one
20: * selector (and therefore no joins), a set of 2-tuples if the query has
21: * two selectors (and therefore one join), a set of 3-tuples if the query
22: * has three selectors (two joins), and so forth.</li>
23: * <li>an optional constraint. When the query is evaluated, the constraint
24: * filters the set of node-tuples.</li>
25: * <li>a list of zero or more orderings. The orderings specify the order in
26: * which the node-tuples appear in the query results. The relative order
27: * of two node-tuples is determined by evaluating the specified orderings,
28: * in list order, until encountering an ordering for which one node-tuple
29: * precedes the other. If no orderings are specified, or if for none of
30: * the specified orderings does one node-tuple precede the other, then the
31: * relative order of the node-tuples is implementation determined (and may
32: * be arbitrary).</li>
33: * <li>a list of zero or more columns to include in the tabular view of the
34: * query results. If no columns are specified, the columns available in
35: * the tabular view are implementation determined, but minimally include,
36: * for each selector, a column for each single-valued non-residual property
37: * of the selector's node type.</li>
38: * </ul>
39: * <p/>
40: * The query object model representation of a query is created by factory
41: * methods in the {@link QueryObjectModelFactory}.
42: *
43: * @since JCR 2.0
44: */
45: public interface QueryObjectModel extends PreparedQuery {
46: /**
47: * Gets the node-tuple source for this query.
48: *
49: * @return the node-tuple source; non-null
50: */
51: public Source getSource();
52:
53: /**
54: * Gets the constraint for this query.
55: *
56: * @return the constraint, or null if none
57: */
58: public Constraint getConstraint();
59:
60: /**
61: * Gets the orderings for this query.
62: *
63: * @return an array of zero or more orderings; non-null
64: */
65: public Ordering[] getOrderings();
66:
67: /**
68: * Gets the columns for this query.
69: *
70: * @return an array of zero or more columns; non-null
71: */
72: public Column[] getColumns();
73: }
74:
75: // EOF
|