1 package org.apache.ojb.broker.query; 2 3 17 18 24 public class FieldCriteria extends SelectionCriteria 25 { 26 static FieldCriteria buildEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 29 { 30 return new FieldCriteria(anAttribute, aValue, EQUAL, anAlias); 31 } 32 33 static FieldCriteria buildNotEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 36 { 37 return new FieldCriteria(anAttribute, aValue, NOT_EQUAL, anAlias); 38 } 39 40 static FieldCriteria buildGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 43 { 44 return new FieldCriteria(anAttribute, aValue,GREATER, anAlias); 45 } 46 47 static FieldCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 50 { 51 return new FieldCriteria(anAttribute, aValue, NOT_GREATER, anAlias); 52 } 53 54 static FieldCriteria buildLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 57 { 58 return new FieldCriteria(anAttribute, aValue, LESS, anAlias); 59 } 60 61 static FieldCriteria buildNotLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 64 { 65 return new FieldCriteria(anAttribute, aValue, NOT_LESS, anAlias); 66 } 67 68 private boolean m_translateField = true; 70 private String m_clause; 71 72 80 FieldCriteria(Object anAttribute, Object aValue, String aClause, UserAlias alias) 83 { 84 super(anAttribute, aValue, alias); 85 m_clause = aClause; 86 } 87 88 91 protected boolean isBindable() 92 { 93 return false; 94 } 95 96 99 public boolean isTranslateField() 100 { 101 return m_translateField; 102 } 103 104 107 void setTranslateField(boolean b) 108 { 109 m_translateField = b; 110 } 111 112 115 public String getClause() 116 { 117 return m_clause; 118 } 119 } 120 121 | Popular Tags |