01: /**********************************************************************
02: Copyright (c) 2007 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: ...
18: **********************************************************************/package org.jpox.store.expression;
19:
20: /**
21: * An expression representing a JOIN in JPQL terms.
22: *
23: * @version $Revision: 1.1 $
24: */
25: public class JoinExpression extends ScalarExpression {
26: /** Field name that we are joining to. */
27: private String fieldName;
28:
29: /** Whether to use a left join (otherwise is inner join). */
30: private boolean leftJoin;
31:
32: /** Whether it is for fetching. */
33: private boolean fetch;
34:
35: /**
36: * Constructor.
37: * @param qs The Query Statement
38: * @param fieldName "Name" for field being joined to
39: * @param leftJoin whether this is a left join, otherwise it is an inner join
40: * @param fetch whether to fetch the right hand expression by the query
41: **/
42: public JoinExpression(QueryExpression qs, String fieldName,
43: boolean leftJoin, boolean fetch) {
44: super (qs);
45:
46: this .fieldName = fieldName;
47: this .leftJoin = leftJoin;
48: this .fetch = fetch;
49: }
50:
51: /**
52: * Accessor for the field name being joined.
53: * @return The field name (including any alias)
54: */
55: public String getFieldName() {
56: return fieldName;
57: }
58:
59: /**
60: * @return the leftJoin
61: */
62: public boolean isLeftJoin() {
63: return leftJoin;
64: }
65:
66: /**
67: * @return the fetch
68: */
69: public boolean isFetch() {
70: return fetch;
71: }
72: }
|