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: ObjectLiteral.java,v 1.3 2003/08/04 16:40:35 pierreg0 Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: class ObjectLiteral extends ObjectExpression {
14: private Object value;
15:
16: public ObjectLiteral(QueryStatement qs, ColumnMapping m,
17: Object value) {
18: super (qs);
19:
20: st.appendParameter(m, value);
21: this .value = value;
22: }
23:
24: public BooleanExpression eq(SQLExpression expr) {
25: if (expr instanceof ObjectLiteral)
26: return new BooleanLiteral(qs, value
27: .equals(((ObjectLiteral) expr).value));
28: else
29: return super .eq(expr);
30: }
31:
32: public BooleanExpression noteq(SQLExpression expr) {
33: if (expr instanceof ObjectLiteral)
34: return new BooleanLiteral(qs, !value
35: .equals(((ObjectLiteral) expr).value));
36: else
37: return super .noteq(expr);
38: }
39:
40: public String toString() {
41: return super .toString() + " = " + value.toString();
42: }
43: }
|