1 10 11 package com.triactive.jdo.store; 12 13 import java.util.Arrays ; 14 15 16 class BinaryLiteral extends BinaryExpression 17 { 18 private final byte[] value; 19 20 public BinaryLiteral(QueryStatement qs, byte[] value) 21 { 22 super(qs); 23 24 this.value = value; 25 26 DatabaseAdapter dba = qs.getStoreManager().getDatabaseAdapter(); 27 st.appendParameter((ColumnMapping)dba.getMapping(byte[].class), value); 28 } 29 30 public BooleanExpression eq(SQLExpression expr) 31 { 32 if (expr instanceof BinaryLiteral) 33 return new BooleanLiteral(qs, Arrays.equals(value, ((BinaryLiteral)expr).value)); 34 else 35 return super.eq(expr); 36 } 37 38 public BooleanExpression noteq(SQLExpression expr) 39 { 40 if (expr instanceof BinaryLiteral) 41 return new BooleanLiteral(qs, !Arrays.equals(value, ((BinaryLiteral)expr).value)); 42 else 43 return super.noteq(expr); 44 } 45 } 46 | Popular Tags |