org.jminor.framework.db.criteria
Class EntityCriteriaUtil
java.lang.Object
org.jminor.framework.db.criteria.EntityCriteriaUtil
public final class EntityCriteriaUtil
- extends Object
A factory class for query criteria implementations.
Method Summary |
static EntityCriteria |
criteria(Entity.Key key)
|
static EntityCriteria |
criteria(List<Entity.Key> keys)
|
static EntityCriteria |
criteria(String entityID)
|
static EntityCriteria |
criteria(String entityID,
Criteria<Property.ColumnProperty> criteria)
|
static EntityCriteria |
criteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
foreignKeyCriteria(Property.ForeignKeyProperty foreignKeyProperty,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
foreignKeyCriteria(String entityID,
String fkPropertyID,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
propertyCriteria(Property.ColumnProperty property,
boolean caseSensitive,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
propertyCriteria(Property.ColumnProperty property,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
propertyCriteria(String entityID,
String propertyID,
boolean caseSensitive,
SearchType searchType,
Object... values)
|
static Criteria<Property.ColumnProperty> |
propertyCriteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
|
static EntitySelectCriteria |
selectCriteria(Entity.Key key)
|
static EntitySelectCriteria |
selectCriteria(List<Entity.Key> keys)
|
static EntitySelectCriteria |
selectCriteria(String entityID)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
Criteria<Property.ColumnProperty> propertyCriteria)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
Criteria<Property.ColumnProperty> criteria,
String orderByClause)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
Criteria<Property.ColumnProperty> propertyCriteria,
String orderByClause,
int fetchCount)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
int fetchCount)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
List<Property.ColumnProperty> foreignKeyReferenceProperties,
List<Entity.Key> primaryKeys)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
String orderByClause)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
String propertyID,
SearchType searchType,
int fetchCount,
Object... values)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
|
static EntitySelectCriteria |
selectCriteria(String entityID,
String propertyID,
SearchType searchType,
String orderByClause,
int fetchCount,
Object... values)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
selectCriteria
public static EntitySelectCriteria selectCriteria(Entity.Key key)
- Parameters:
key
- the key
- Returns:
- a select criteria based on the given key
selectCriteria
public static EntitySelectCriteria selectCriteria(List<Entity.Key> keys)
- Parameters:
keys
- the keys
- Returns:
- a select criteria based on the given keys
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDsearchType
- the search typevalues
- the criteria values
- Returns:
- a select criteria based on the given values
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
String propertyID,
SearchType searchType,
int fetchCount,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDsearchType
- the search typefetchCount
- the maximum number of entities to fetchvalues
- the criteria values
- Returns:
- a select criteria based on the given values
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
String propertyID,
SearchType searchType,
String orderByClause,
int fetchCount,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDsearchType
- the search typeorderByClause
- the order by clausefetchCount
- the maximum number of entities to fetchvalues
- the criteria values
- Returns:
- a select criteria based on the given values
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
String orderByClause)
- Parameters:
entityID
- the entity IDorderByClause
- the order by clause
- Returns:
- a select criteria including all entities of the given type
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
List<Property.ColumnProperty> foreignKeyReferenceProperties,
List<Entity.Key> primaryKeys)
- Parameters:
entityID
- the entity IDforeignKeyReferenceProperties
- the foreign key reference propertiesprimaryKeys
- the primary keys referenced by the given properties
- Returns:
- a select criteria based on the given values
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
Criteria<Property.ColumnProperty> criteria,
String orderByClause)
- Parameters:
entityID
- the entity IDcriteria
- the column criteriaorderByClause
- the order by clause
- Returns:
- a select criteria based on the given column criteria
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
Criteria<Property.ColumnProperty> propertyCriteria,
String orderByClause,
int fetchCount)
- Parameters:
entityID
- the entity IDpropertyCriteria
- the column criteriaorderByClause
- the order by clausefetchCount
- the maximum number of entities to fetch
- Returns:
- a select criteria based on the given column criteria
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID)
- Parameters:
entityID
- the entity ID
- Returns:
- a select criteria encompassing all entities of the given type
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
int fetchCount)
- Parameters:
entityID
- the entity IDfetchCount
- the maximum number of entities to fetch
- Returns:
- a select criteria encompassing all entities of the given type
selectCriteria
public static EntitySelectCriteria selectCriteria(String entityID,
Criteria<Property.ColumnProperty> propertyCriteria)
- Parameters:
entityID
- the entity IDpropertyCriteria
- the column criteria
- Returns:
- a select criteria based on the given column criteria
criteria
public static EntityCriteria criteria(Entity.Key key)
- Parameters:
key
- the primary key
- Returns:
- a criteria specifying the entity having the given primary key
criteria
public static EntityCriteria criteria(List<Entity.Key> keys)
- Parameters:
keys
- the primary keys
- Returns:
- a criteria specifying the entities having the given primary keys
criteria
public static EntityCriteria criteria(String entityID)
- Parameters:
entityID
- the entity ID
- Returns:
- a criteria specifying all entities of the given type
criteria
public static EntityCriteria criteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDsearchType
- the search typevalues
- the criteria values
- Returns:
- a criteria based on the given values
propertyCriteria
public static Criteria<Property.ColumnProperty> propertyCriteria(String entityID,
String propertyID,
SearchType searchType,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDsearchType
- the search typevalues
- the criteria values
- Returns:
- a property criteria based on the given values
propertyCriteria
public static Criteria<Property.ColumnProperty> propertyCriteria(String entityID,
String propertyID,
boolean caseSensitive,
SearchType searchType,
Object... values)
- Parameters:
entityID
- the entity IDpropertyID
- the property IDcaseSensitive
- true if the criteria should be case sensitive, only applicable to string propertiessearchType
- the search typevalues
- the criteria values
- Returns:
- a property criteria based on the given values
propertyCriteria
public static Criteria<Property.ColumnProperty> propertyCriteria(Property.ColumnProperty property,
SearchType searchType,
Object... values)
- Parameters:
property
- the propertysearchType
- the search typevalues
- the criteria values
- Returns:
- a property criteria based on the given values
propertyCriteria
public static Criteria<Property.ColumnProperty> propertyCriteria(Property.ColumnProperty property,
boolean caseSensitive,
SearchType searchType,
Object... values)
- Parameters:
property
- the propertysearchType
- the search typecaseSensitive
- true if the criteria should be case sensitive, only applicable to string propertiesvalues
- the criteria values
- Returns:
- a property criteria based on the given values
foreignKeyCriteria
public static Criteria<Property.ColumnProperty> foreignKeyCriteria(String entityID,
String fkPropertyID,
SearchType searchType,
Object... values)
- Parameters:
entityID
- the entity IDfkPropertyID
- the property IDsearchType
- the search typevalues
- the criteria values
- Returns:
- a foreign key property criteria based on the given values
foreignKeyCriteria
public static Criteria<Property.ColumnProperty> foreignKeyCriteria(Property.ForeignKeyProperty foreignKeyProperty,
SearchType searchType,
Object... values)
- Parameters:
foreignKeyProperty
- the foreign key propertysearchType
- the search typevalues
- the criteria values
- Returns:
- a property criteria based on the given values
criteria
public static EntityCriteria criteria(String entityID,
Criteria<Property.ColumnProperty> criteria)
- Parameters:
entityID
- the entity IDcriteria
- the column criteria
- Returns:
- a criteria based on the given column criteria