1 package org.apache.ojb.broker.query; 2 3 17 18 24 public class BetweenCriteria extends ValueCriteria 25 { 26 private Object value2; 27 28 BetweenCriteria(Object anAttribute, Object aValue1, Object aValue2, String aClause, String anAlias) 29 { 30 super(anAttribute, aValue1, aClause, anAlias); 31 setValue2(aValue2); 32 } 33 34 BetweenCriteria(Object anAttribute, Object aValue1, Object aValue2, String aClause, UserAlias aUserAlias) 36 { 37 super(anAttribute, aValue1, aClause, aUserAlias); 38 setValue2(aValue2); 39 } 40 41 46 public void bind(Object newValue) 47 { 48 if (getValue() == null) 49 { 50 setValue(newValue); 51 } 52 else 53 { 54 setValue2(newValue); 55 setBound(true); 56 } 57 } 58 59 60 64 public Object getValue2() 65 { 66 return value2; 67 } 68 69 73 protected void setValue2(Object value2) 74 { 75 this.value2 = value2; 76 } 77 78 81 protected boolean isBindable() 82 { 83 return (getValue() == null && getValue2() == null); 84 } 85 86 90 public String toString() 91 { 92 return super.toString() + " AND " + value2; 93 } 94 } 95 96 | Popular Tags |