org.kuali.rice.core.jdbc.criteria
Class Criteria
java.lang.Object
org.kuali.rice.core.jdbc.criteria.Criteria
- Direct Known Subclasses:
- Criteria.AndCriteria, Criteria.OrCriteria
public class Criteria
- extends Object
A criteria builder for JDBC Query strings.
TODO: Rewrite this class with a better criteria building algorithm.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Method Summary |
void |
and(Criteria and)
|
void |
between(String attribute,
Object value1,
Object value2,
Class propertyType)
|
String |
buildWhere()
|
private String |
buildWhere(Criteria parentCriteria)
|
void |
distinct(boolean distinct)
|
void |
eq(String attribute,
Object value,
Class propertyType)
This method ... |
String |
establishDateString(String fromDate,
String toDate,
String columnDbName,
String whereStatementClause)
|
private String |
fix(String queryString)
|
private String |
fixValue(Object value,
Class propertyType)
|
private static String |
fixWildcards(String sIn)
|
String |
getAlias()
|
DatabasePlatform |
getDbPlatform()
|
private String |
getFixedTemporalValue(Object value)
Prepares a temporally classed value for inclusion in criteria |
List<Object> |
getParameteres()
|
List<Object> |
getParameteres(List tokens,
Map<String,Object> params)
|
Integer |
getSearchLimit()
|
void |
gt(String attribute,
Object value,
Class propertyType)
|
void |
gte(String attribute,
Object value,
Class propertyType)
|
void |
in(String match,
Criteria subQuery,
String attribute,
Class propertyType)
This method ... |
void |
in(String attribute,
List values,
Class propertyType)
|
void |
isNull(String attribute)
|
void |
like(String attribute,
Object value,
Class propertyType,
boolean allowWildcards)
|
void |
lt(String attribute,
Object value,
Class propertyType)
|
void |
lte(String attribute,
Object value,
Class propertyType)
|
void |
ne(String attribute,
Object value,
Class propertyType)
|
void |
notBetween(String attribute,
Object value1,
Object value2,
Class propertyType)
This method ... |
void |
notIn(String attribute,
List values,
Class propertyType)
|
void |
notLike(String attribute,
Object value,
Class propertyType,
boolean allowWildcards)
|
void |
notNull(String attribute)
|
void |
or(Criteria or)
|
void |
orderBy(String attribute,
boolean sortAscending)
|
(package private) void |
prepareParameters(javax.persistence.Query query)
|
(package private) void |
prepareParameters(javax.persistence.Query query,
List tokens,
Map<String,Object> params)
|
void |
rawJpql(String jpql)
|
void |
setDbPlatform(DatabasePlatform dbPlatform)
|
void |
setSearchLimit(Integer searchLimit)
|
private String |
stripFunctions(String attribute)
|
String |
toCountQuery()
|
String |
toQuery(QueryByCriteria.QueryByCriteriaType type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static org.apache.log4j.Logger LOG
searchLimit
private Integer searchLimit
entityName
private String entityName
alias
private String alias
bindParamCount
private int bindParamCount
distinct
private boolean distinct
tokens
protected List tokens
orderByTokens
private List orderByTokens
params
protected Map<String,Object> params
dbPlatform
DatabasePlatform dbPlatform
Criteria
public Criteria(String entityName)
Criteria
public Criteria(String entityName,
String alias)
getDbPlatform
public DatabasePlatform getDbPlatform()
setDbPlatform
public void setDbPlatform(DatabasePlatform dbPlatform)
between
public void between(String attribute,
Object value1,
Object value2,
Class propertyType)
fixValue
private String fixValue(Object value,
Class propertyType)
getFixedTemporalValue
private String getFixedTemporalValue(Object value)
- Prepares a temporally classed value for inclusion in criteria
- Parameters:
value
- the Timestamp value to convert
- Returns:
- the fixed SQL version of that value
eq
public void eq(String attribute,
Object value,
Class propertyType)
- This method ...
- Parameters:
string
-
gt
public void gt(String attribute,
Object value,
Class propertyType)
gte
public void gte(String attribute,
Object value,
Class propertyType)
like
public void like(String attribute,
Object value,
Class propertyType,
boolean allowWildcards)
notLike
public void notLike(String attribute,
Object value,
Class propertyType,
boolean allowWildcards)
fixWildcards
private static String fixWildcards(String sIn)
lt
public void lt(String attribute,
Object value,
Class propertyType)
lte
public void lte(String attribute,
Object value,
Class propertyType)
ne
public void ne(String attribute,
Object value,
Class propertyType)
isNull
public void isNull(String attribute)
rawJpql
public void rawJpql(String jpql)
in
public void in(String attribute,
List values,
Class propertyType)
notIn
public void notIn(String attribute,
List values,
Class propertyType)
orderBy
public void orderBy(String attribute,
boolean sortAscending)
and
public void and(Criteria and)
or
public void or(Criteria or)
toQuery
public String toQuery(QueryByCriteria.QueryByCriteriaType type)
toCountQuery
public String toCountQuery()
fix
private String fix(String queryString)
buildWhere
public String buildWhere()
buildWhere
private String buildWhere(Criteria parentCriteria)
prepareParameters
void prepareParameters(javax.persistence.Query query)
getParameteres
public List<Object> getParameteres()
getParameteres
public List<Object> getParameteres(List tokens,
Map<String,Object> params)
prepareParameters
void prepareParameters(javax.persistence.Query query,
List tokens,
Map<String,Object> params)
getSearchLimit
public Integer getSearchLimit()
setSearchLimit
public void setSearchLimit(Integer searchLimit)
notNull
public void notNull(String attribute)
distinct
public void distinct(boolean distinct)
notBetween
public void notBetween(String attribute,
Object value1,
Object value2,
Class propertyType)
- This method ...
- Parameters:
string
- timestamp
- timestamp2
-
in
public void in(String match,
Criteria subQuery,
String attribute,
Class propertyType)
- This method ...
- Parameters:
string
- responsibilitySubQuery
-
stripFunctions
private String stripFunctions(String attribute)
getAlias
public String getAlias()
establishDateString
public String establishDateString(String fromDate,
String toDate,
String columnDbName,
String whereStatementClause)
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.