1 10 11 package com.triactive.jdo.store; 12 13 14 class ObjectLiteral extends ObjectExpression 15 { 16 private Object value; 17 18 public ObjectLiteral(QueryStatement qs, ColumnMapping m, Object value) 19 { 20 super(qs); 21 22 st.appendParameter(m, value); 23 this.value = value; 24 } 25 26 public BooleanExpression eq(SQLExpression expr) 27 { 28 if (expr instanceof ObjectLiteral) 29 return new BooleanLiteral(qs, value.equals(((ObjectLiteral)expr).value)); 30 else 31 return super.eq(expr); 32 } 33 34 public BooleanExpression noteq(SQLExpression expr) 35 { 36 if (expr instanceof ObjectLiteral) 37 return new BooleanLiteral(qs, !value.equals(((ObjectLiteral)expr).value)); 38 else 39 return super.noteq(expr); 40 } 41 42 public String toString() 43 { 44 return super.toString() + " = " + value.toString(); 45 } 46 } 47 | Popular Tags |