KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > Join


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: Join.java,v 1.2 2002/10/17 21:00:56 pierreg0 Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13 import javax.jdo.JDOFatalInternalException;
14
15
16 class Join
17 {
18     public static final int INNER_JOIN = 0;
19     public static final int LEFT_OUTER_JOIN = 1;
20     public static final int RIGHT_OUTER_JOIN = 2;
21
22     private static final String JavaDoc[] joinTypeStrings =
23     {
24         " INNER JOIN ",
25         " LEFT OUTER JOIN ",
26         " RIGHT OUTER JOIN "
27     };
28
29     public final int joinType;
30     public final String JavaDoc joinTypeString;
31     public final TableExpression tableExpr;
32     public final BooleanExpression condition;
33
34     public Join(int joinType, TableExpression tableExpr, BooleanExpression condition)
35     {
36         if (joinType < 0 || joinType >= joinTypeStrings.length)
37             throw new JDOFatalInternalException("Illegal join type: " + joinType);
38
39         this.joinType = joinType;
40         this.tableExpr = tableExpr;
41         this.condition = condition;
42
43         joinTypeString = joinTypeStrings[joinType];
44     }
45 }
46
Popular Tags