1 package org.apache.ojb.broker.query; 2 3 17 18 25 public class ValueCriteria extends SelectionCriteria 26 { 27 static ValueCriteria buildEqualToCriteria(Object anAttribute, Object aValue, String anAlias) 28 { 29 return new ValueCriteria(anAttribute, aValue, EQUAL, anAlias); 30 } 31 32 static ValueCriteria buildEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 33 { 34 return new ValueCriteria(anAttribute, aValue, EQUAL, anAlias); 35 } 36 37 static ValueCriteria buildNotEqualToCriteria(Object anAttribute, Object aValue, String anAlias) 38 { 39 return new ValueCriteria(anAttribute, aValue, NOT_EQUAL, anAlias); 40 } 41 static ValueCriteria buildNotEqualToCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 42 { 43 return new ValueCriteria(anAttribute, aValue, NOT_EQUAL, anAlias); 44 } 45 46 static ValueCriteria buildGreaterCriteria(Object anAttribute, Object aValue, String anAlias) 47 { 48 return new ValueCriteria(anAttribute, aValue,GREATER, anAlias); 49 } 50 static ValueCriteria buildGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 51 { 52 return new ValueCriteria(anAttribute, aValue,GREATER, anAlias); 53 } 54 55 static ValueCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, String anAlias) 56 { 57 return new ValueCriteria(anAttribute, aValue, NOT_GREATER, anAlias); 58 } 59 static ValueCriteria buildNotGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 60 { 61 return new ValueCriteria(anAttribute, aValue, NOT_GREATER, anAlias); 62 } 63 64 static ValueCriteria buildLessCriteria(Object anAttribute, Object aValue, String anAlias) 65 { 66 return new ValueCriteria(anAttribute, aValue, LESS, anAlias); 67 } 68 static ValueCriteria buildLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 69 { 70 return new ValueCriteria(anAttribute, aValue, LESS, anAlias); 71 } 72 73 static ValueCriteria buildNotLessCriteria(Object anAttribute, Object aValue, String anAlias) 74 { 75 return new ValueCriteria(anAttribute, aValue, NOT_LESS, anAlias); 76 } 77 static ValueCriteria buildNotLessCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 78 { 79 return new ValueCriteria(anAttribute, aValue, NOT_LESS, anAlias); 80 } 81 82 static ValueCriteria buildLikeCriteria(Object anAttribute, Object aValue, String anAlias) 83 { 84 return new LikeCriteria(anAttribute, aValue, LIKE, anAlias); 85 } 86 static ValueCriteria buildLikeCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 87 { 88 return new LikeCriteria(anAttribute, aValue, LIKE, anAlias); 89 } 90 91 static ValueCriteria buildNotLikeCriteria(Object anAttribute, Object aValue, String anAlias) 92 { 93 return new ValueCriteria(anAttribute, aValue, NOT_LIKE, anAlias); 94 } 95 static ValueCriteria buildNotLikeCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 96 { 97 return new LikeCriteria(anAttribute, aValue, NOT_LIKE, anAlias); 98 } 99 100 static InCriteria buildInCriteria(Object anAttribute, Object aValue, String anAlias) 101 { 102 return new InCriteria(anAttribute, aValue, IN, anAlias); 103 } 104 static InCriteria buildInCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 105 { 106 return new InCriteria(anAttribute, aValue, IN, anAlias); 107 } 108 109 static InCriteria buildNotInCriteria(Object anAttribute, Object aValue, String anAlias) 110 { 111 return new InCriteria(anAttribute, aValue, NOT_IN, anAlias); 112 } 113 static InCriteria buildNotInCriteria(Object anAttribute, Object aValue, UserAlias anAlias) 114 { 115 return new InCriteria(anAttribute, aValue, NOT_IN, anAlias); 116 } 117 118 static NullCriteria buildNullCriteria(String anAttribute, String anAlias) 119 { 120 return new NullCriteria(anAttribute, IS_NULL, anAlias); 121 } 122 static NullCriteria buildNullCriteria(String anAttribute, UserAlias anAlias) 123 { 124 return new NullCriteria(anAttribute, IS_NULL, anAlias); 125 } 126 127 static NullCriteria buildNotNullCriteria(String anAttribute, String anAlias) 128 { 129 return new NullCriteria(anAttribute, NOT_IS_NULL, anAlias); 130 } 131 static NullCriteria buildNotNullCriteria(String anAttribute, UserAlias anAlias) 132 { 133 return new NullCriteria(anAttribute, NOT_IS_NULL, anAlias); 134 } 135 136 static BetweenCriteria buildBeweenCriteria(Object anAttribute, Object aValue1, Object aValue2, String anAlias) 137 { 138 return new BetweenCriteria(anAttribute, aValue1, aValue2, BETWEEN, anAlias); 139 } 140 static BetweenCriteria buildBeweenCriteria(Object anAttribute, Object aValue1, Object aValue2, UserAlias anAlias) 141 { 142 return new BetweenCriteria(anAttribute, aValue1, aValue2, BETWEEN, anAlias); 143 } 144 145 static BetweenCriteria buildNotBeweenCriteria(Object anAttribute, Object aValue1, Object aValue2, String anAlias) 146 { 147 return new BetweenCriteria(anAttribute, aValue1, aValue2, NOT_BETWEEN, anAlias); 148 } 149 static BetweenCriteria buildNotBeweenCriteria(Object anAttribute, Object aValue1, Object aValue2, UserAlias anAlias) 150 { 151 return new BetweenCriteria(anAttribute, aValue1, aValue2, NOT_BETWEEN, anAlias); 152 } 153 154 private String m_clause; 155 156 164 ValueCriteria(Object anAttribute, Object aValue, String aClause, String anAlias) 165 { 166 super(anAttribute, aValue, anAlias); 167 m_clause = aClause; 168 } 169 170 178 ValueCriteria(Object anAttribute, Object aValue, String aClause, UserAlias aUserAlias) 179 { 180 super(anAttribute, aValue, aUserAlias); 181 m_clause = aClause; 182 } 183 184 187 public String getClause() 188 { 189 return m_clause; 190 } 191 192 } 193 | Popular Tags |