|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--uk.co.kimble.cobra.criteria.PersistentCriteria
Persistent Criteria can be used to retrieve sets of objects based on their attributes Normally each attribute is ANDed together, an OR can be performed by creating a new PersistentCriteria and adding it.
Criteria are used, rather than a simple string, because they can be precompiled for efficiency.
| Constructor Summary | |
PersistentCriteria()
|
|
| Method Summary | |
void |
addEqualTo(java.lang.String attribute,
java.lang.Object value)
Adds and equals (=) criteria, customer_id = 10034 Where Value is a string simple pattern matching can be used, the character * is a wildcard, e.g. |
void |
addGreaterThan(java.lang.String attribute,
java.lang.Object value)
Adds Greater Than (>) criteria, customer_id > 10034 |
void |
addLessThan(java.lang.String attribute,
java.lang.Object value)
Adds Less Than (<) criteria, customer_id < 10034 |
void |
addOrCriteria(PersistentCriteria pc)
ORs two sets of criteria together: active = true AND balance < 0 OR active = true AND overdraft = 0 |
java.util.Enumeration |
getElements()
|
java.lang.String |
getOrderby()
|
void |
orderBy(java.lang.String column)
ORs two sets of criteria together: active = true AND balance < 0 OR active = true AND overdraft = 0 |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public PersistentCriteria()
| Method Detail |
public java.util.Enumeration getElements()
public void addEqualTo(java.lang.String attribute,
java.lang.Object value)
Where Value is a string simple pattern matching can be used, the character * is a wildcard, e.g. customer_name = Ander*
Would match the customers: Anderson and Anderton. The character ? matches a single occurence of a character.
attribute - The field name to be usedvalue - An object representing the value of the field
public void addGreaterThan(java.lang.String attribute,
java.lang.Object value)
attribute - The field name to be usedvalue - An object representing the value of the field
public void addLessThan(java.lang.String attribute,
java.lang.Object value)
attribute - The field name to be usedvalue - An object representing the value of the field
public void addOrCriteria(PersistentCriteria pc)
throws PersistentException
persistent - criteriapublic void orderBy(java.lang.String column)
persistent - criteriapublic java.lang.String getOrderby()
public java.lang.String toString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||