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: ObjectExpression.java,v 1.4 2003/08/11 16:01:52 pierreg0 Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: class ObjectExpression extends SQLExpression {
14: protected ObjectExpression(QueryStatement qs) {
15: super (qs);
16: }
17:
18: public ObjectExpression(QueryStatement qs,
19: QueryStatement.QueryColumn qsc) {
20: super (qs, qsc);
21: }
22:
23: public ObjectExpression(QueryStatement qs,
24: QueryStatement.QueryColumn qsc, String outerJoinSuffix) {
25: this (qs, qsc);
26: st.append(outerJoinSuffix);
27: }
28:
29: public BooleanExpression eq(SQLExpression expr) {
30: if (expr instanceof NullLiteral)
31: return expr.eq(this );
32: else if (expr instanceof ObjectExpression)
33: return new BooleanExpression(this , OP_EQ, expr);
34: else
35: return super .eq(expr);
36: }
37:
38: public BooleanExpression noteq(SQLExpression expr) {
39: if (expr instanceof NullLiteral)
40: return expr.noteq(this );
41: else if (expr instanceof ObjectExpression)
42: return new BooleanExpression(this , OP_NOTEQ, expr);
43: else
44: return super .noteq(expr);
45: }
46:
47: public BooleanExpression in(SQLExpression expr) {
48: return new BooleanExpression(this, OP_IN, expr);
49: }
50: }
|