|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap net.sourceforge.pbeans.Criteria
public class Criteria
Criteria is a simple HashMap
with additional bells and whistles.
When using criteria instead of simple map, you can use any operator for identifying
needed objects in the database.
Example of using Criteria
.
Criteria criteria = new Criteria();
criteria.put("userName", "joe");
criteria.put("age", "30", Operator.LESS_THAN);
criteria.put("description", "%book%", new SimpleOperator(" LIKE "));
ResultsIterator iterator = store.select(User.class, criteria);
Constructor Summary | |
---|---|
Criteria()
Creates new criteria. |
|
Criteria(java.util.Map comparisonoperatorMap)
Creates new criteria using specified operator mapping. |
|
Criteria(java.util.Map logicaloperatorMap,
LogicalOperator defaultLogicalOperator)
Creates new criteria using specified operator mapping and default logical operator. |
|
Criteria(java.util.Map comparisonoperatorMap,
Operator defaultComparisonOperator)
Creates new criteria using specified operator mapping and default operator. |
|
Criteria(java.util.Map comparisonoperatorMap,
Operator defaultcomparisonOperator,
LogicalOperator defaultLogicalOperator)
Creates new criteria using specified operator mapping and default logical operator. |
|
Criteria(java.util.Map comparisonoperatorMap,
Operator defaultComparisonOperator,
java.util.Map logicalOperatorMap,
LogicalOperator defaultLogicalOperator)
Creates new criteria using specified operator mapping and default comparison operator and default logical operator. |
Method Summary | |
---|---|
Operator |
getDefaultComparisonOperator()
|
LogicalOperator |
getDefaultLogicalOperator()
|
LogicalOperator |
getLogicalOperator(java.lang.Object key)
Returns logical operator associated with specified key. |
java.util.Map |
getLogicalOperatorMap()
|
Operator |
getOperator(java.lang.Object key)
Returns operator associated with specified key. |
java.util.Map |
getOperatorMap()
Returns internal operator map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
LogicalOperator logicalOperator)
Same as HashMap.put(java.lang.Object, java.lang.Object) , but also
associates specified logical operator with the key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
Operator operator)
Same as HashMap.put(java.lang.Object, java.lang.Object) , but also
associates specified comparison operator with the key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
Operator operator,
LogicalOperator logicalOperator)
Same as HashMap.put(java.lang.Object, java.lang.Object) , but also
associates specified logical and comparison operator with the key. |
LogicalOperator |
putLogicalOperator(java.lang.Object key,
LogicalOperator operator)
Specifies logical operator to use on the key. |
Operator |
putOperator(java.lang.Object key,
Operator operator)
Specifies operator to use on the key. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for the specified key from this criteria if present. |
LogicalOperator |
removeLogicalOperator(java.lang.Object key)
Removes logical operator used for the specified key. |
Operator |
removeOperator(java.lang.Object key)
Removes operator used for the specified key. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public Criteria(java.util.Map comparisonoperatorMap, Operator defaultComparisonOperator)
comparisonoperatorMap
- operator mapping for this criteria.defaultComparisonOperator
- default operator to use when no operator mapping exists for a key.public Criteria(java.util.Map logicaloperatorMap, LogicalOperator defaultLogicalOperator)
logicaloperatorMap
- operator mapping for this criteria.defaultLogicalOperator
- default operator to use when no operator mapping exists for a key.public Criteria(java.util.Map comparisonoperatorMap, Operator defaultcomparisonOperator, LogicalOperator defaultLogicalOperator)
comparisonoperatorMap
- operator mapping for this criteria.defaultcomparisonOperator
- default operator to use when no operator mapping exists for a key.public Criteria(java.util.Map comparisonoperatorMap, Operator defaultComparisonOperator, java.util.Map logicalOperatorMap, LogicalOperator defaultLogicalOperator)
comparisonoperatorMap
- Comparison operator mapping for this criteria.defaultComparisonOperator
- Comparison operator to use when no comparison operator mapping exists for a key.logicalOperatorMap
- defaultLogicalOperator
- public Criteria(java.util.Map comparisonoperatorMap)
Operator.EQUALS
for default comparison operator.
comparisonoperatorMap
- operator mapping for this criteria.public Criteria()
HashMap
for operators and equality operator for default operator.
Method Detail |
---|
public java.util.Map getOperatorMap()
public java.util.Map getLogicalOperatorMap()
public Operator getOperator(java.lang.Object key)
key
- key whose operator is to be returned.
null
operator associated with it. Should never return null
.public Operator putOperator(java.lang.Object key, Operator operator)
key
- the key.operator
- the new operator.
public Operator removeOperator(java.lang.Object key)
key
- key whose operator is to be removed.
public LogicalOperator getLogicalOperator(java.lang.Object key)
key
- key whose logical operator is to be returned.
null
logical operator associated with it. Should never return null
.public LogicalOperator putLogicalOperator(java.lang.Object key, LogicalOperator operator)
key
- the key.operator
- the new operator.
public LogicalOperator removeLogicalOperator(java.lang.Object key)
key
- key whose operator is to be removed.
public java.lang.Object put(java.lang.Object key, java.lang.Object value, Operator operator)
HashMap.put(java.lang.Object, java.lang.Object)
, but also
associates specified comparison operator with the key.
public java.lang.Object put(java.lang.Object key, java.lang.Object value, LogicalOperator logicalOperator)
HashMap.put(java.lang.Object, java.lang.Object)
, but also
associates specified logical operator with the key.
public java.lang.Object put(java.lang.Object key, java.lang.Object value, Operator operator, LogicalOperator logicalOperator)
HashMap.put(java.lang.Object, java.lang.Object)
, but also
associates specified logical and comparison operator with the key.
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.HashMap
key
- key whose mapping is to be removed from the map.
HashMap.remove(java.lang.Object)
public LogicalOperator getDefaultLogicalOperator()
public Operator getDefaultComparisonOperator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |