KickJava   Java API By Example, From Geeks To Geeks.

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


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: ObjectExpression.java,v 1.4 2003/08/11 16:01:52 pierreg0 Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13
14 class ObjectExpression extends SQLExpression
15 {
16     protected ObjectExpression(QueryStatement qs)
17     {
18     super(qs);
19     }
20
21     public ObjectExpression(QueryStatement qs, QueryStatement.QueryColumn qsc)
22     {
23     super(qs, qsc);
24     }
25
26     public ObjectExpression(QueryStatement qs, QueryStatement.QueryColumn qsc, String JavaDoc outerJoinSuffix)
27     {
28     this(qs, qsc);
29         st.append(outerJoinSuffix);
30     }
31
32     public BooleanExpression eq(SQLExpression expr)
33     {
34         if (expr instanceof NullLiteral)
35             return expr.eq(this);
36         else if (expr instanceof ObjectExpression)
37             return new BooleanExpression(this, OP_EQ, expr);
38         else
39             return super.eq(expr);
40     }
41
42     public BooleanExpression noteq(SQLExpression expr)
43     {
44         if (expr instanceof NullLiteral)
45             return expr.noteq(this);
46         else if (expr instanceof ObjectExpression)
47             return new BooleanExpression(this, OP_NOTEQ, expr);
48         else
49             return super.noteq(expr);
50     }
51     
52     public BooleanExpression in(SQLExpression expr)
53     {
54         return new BooleanExpression(this, OP_IN, expr);
55     }
56 }
57
Popular Tags