01: /*
02: * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
03: */
04: package javax.jcr.query.qom;
05:
06: /**
07: * Tests whether two nodes are "the same" according to the <code>isSame</code>
08: * method of <code>javax.jcr.Item</code>.
09: * <p/>
10: * If {@link #getSelector2Path selector2Path} is omitted:
11: * <ul><li>Tests whether the {@link #getSelector1Name selector1} node is the
12: * same as the {@link #getSelector2Name selector2} node. A node-tuple
13: * satisfies the constraint only if:
14: * <pre> selector1Node.isSame(selector2Node)</pre>
15: * would return true, where <code>selector1Node</code> is the node
16: * for {@link #getSelector1Name selector1} and <code>selector2Node</code>
17: * is the node for {@link #getSelector2Name selector2}.</li></ul>
18: * Otherwise, if {@link #getSelector2Path selector2Path} is specified:
19: * <ul><li>Tests whether the {@link #getSelector1Name selector1} node is the
20: * same as a node identified by relative path from the
21: * {@link #getSelector2Name selector2} node. A node-tuple satisfies
22: * the constraint only if:
23: * <pre> selector1Node.isSame(selector2Node.getNode(selector2Path))</pre>
24: * would return true, where <code>selector1Node</code> is the node for
25: * {@link #getSelector1Name selector1} and <code>selector2Node</code>
26: * is the node for {@link #getSelector2Name selector2}.</li></ul>
27: * <p/>
28: * The query is invalid if:
29: * <ul>
30: * <li>{@link #getSelector1Name selector1} is not the name of a selector in the
31: * query, or</li>
32: * <li>{@link #getSelector2Name selector2} is not the name of a selector in the
33: * query, or</li>
34: * <li>{@link #getSelector1Name selector1} is the same as
35: * {@link #getSelector2Name selector2}, or</li>
36: * <li>{@link #getSelector2Path selector2Path} is not a syntactically valid
37: * relative path. Note, however, that if the path is syntactically valid
38: * but does not identify a node in the repository (or the node is not
39: * visible to this session, because of access control constraints), the
40: * query is valid but the constraint is not satisfied.</li>
41: * </ul>
42: *
43: * @since JCR 2.0
44: */
45: public interface SameNodeJoinCondition extends JoinCondition {
46: /**
47: * Gets the name of the first selector.
48: *
49: * @return the selector name; non-null
50: */
51: public String getSelector1Name();
52:
53: /**
54: * Gets the name of the second selector.
55: *
56: * @return the selector name; non-null
57: */
58: public String getSelector2Name();
59:
60: /**
61: * Gets the path relative to the second selector.
62: *
63: * @return the relative path, or null for none
64: */
65: public String getSelector2Path();
66: }
67:
68: // EOF
|