org.jminor.framework.db.criteria
Class EntityCriteriaUtil

java.lang.Object
  extended by 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
 

Method Detail

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 ID
propertyID - the property ID
searchType - the search type
values - 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 ID
propertyID - the property ID
searchType - the search type
fetchCount - the maximum number of entities to fetch
values - 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 ID
propertyID - the property ID
searchType - the search type
orderByClause - the order by clause
fetchCount - the maximum number of entities to fetch
values - 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 ID
orderByClause - 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 ID
foreignKeyReferenceProperties - the foreign key reference properties
primaryKeys - 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 ID
criteria - the column criteria
orderByClause - 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 ID
propertyCriteria - the column criteria
orderByClause - the order by clause
fetchCount - 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 ID
fetchCount - 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 ID
propertyCriteria - 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 ID
propertyID - the property ID
searchType - the search type
values - 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 ID
propertyID - the property ID
searchType - the search type
values - 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 ID
propertyID - the property ID
caseSensitive - true if the criteria should be case sensitive, only applicable to string properties
searchType - the search type
values - 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 property
searchType - the search type
values - 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 property
searchType - the search type
caseSensitive - true if the criteria should be case sensitive, only applicable to string properties
values - 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 ID
fkPropertyID - the property ID
searchType - the search type
values - 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 property
searchType - the search type
values - 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 ID
criteria - the column criteria
Returns:
a criteria based on the given column criteria