01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: Join.java,v 1.2 2002/10/17 21:00:56 pierreg0 Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: import javax.jdo.JDOFatalInternalException;
14:
15: class Join {
16: public static final int INNER_JOIN = 0;
17: public static final int LEFT_OUTER_JOIN = 1;
18: public static final int RIGHT_OUTER_JOIN = 2;
19:
20: private static final String[] joinTypeStrings = { " INNER JOIN ",
21: " LEFT OUTER JOIN ", " RIGHT OUTER JOIN " };
22:
23: public final int joinType;
24: public final String joinTypeString;
25: public final TableExpression tableExpr;
26: public final BooleanExpression condition;
27:
28: public Join(int joinType, TableExpression tableExpr,
29: BooleanExpression condition) {
30: if (joinType < 0 || joinType >= joinTypeStrings.length)
31: throw new JDOFatalInternalException("Illegal join type: "
32: + joinType);
33:
34: this.joinType = joinType;
35: this.tableExpr = tableExpr;
36: this.condition = condition;
37:
38: joinTypeString = joinTypeStrings[joinType];
39: }
40: }
|