public class HqlAndParametersBuilder<E extends TopiaEntity> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
alias |
protected Class<E> |
entityClass |
protected com.google.common.base.Joiner |
hqlClausesJoiner |
protected Set<String> |
orderByArguments |
protected Map<String,Object> |
parameters |
protected String |
selectClause |
protected Set<String> |
whereClauses |
| Constructor and Description |
|---|
HqlAndParametersBuilder(Class<E> entityClass) |
HqlAndParametersBuilder(Class<E> entityClass,
String alias) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollectionIsEmpty(String property) |
void |
addCollectionIsNotEmpty(String property) |
void |
addContains(String property,
Object value) |
void |
addEquals(String property,
Object value) |
void |
addGreaterOrEquals(String property,
Date date) |
void |
addGreaterOrEquals(String property,
Number number) |
void |
addGreaterOrEquals(String property,
String string) |
void |
addGreaterThan(String property,
Date date) |
void |
addGreaterThan(String property,
Number number) |
void |
addGreaterThan(String property,
String string) |
void |
addIn(String property,
Collection<?> values) |
protected void |
addInOrNotIn(String property,
Collection<?> values,
boolean in) |
void |
addLike(String property,
String pattern) |
void |
addLowerOrEquals(String property,
Date date) |
void |
addLowerOrEquals(String property,
Number number) |
void |
addLowerOrEquals(String property,
String string) |
void |
addLowerThan(String property,
Date date) |
void |
addLowerThan(String property,
Number number) |
void |
addLowerThan(String property,
String string) |
void |
addNotContains(String property,
Object value) |
void |
addNotEquals(String property,
Object value) |
void |
addNotIn(String property,
Collection<?> values) |
void |
addNotLike(String property,
String pattern) |
void |
addNotNull(String property) |
void |
addNull(String property) |
void |
addTopiaIdEquals(String property,
String topiaId) |
void |
addTopiaIdIn(String property,
Collection<String> topiaIds) |
void |
addTopiaIdNotEquals(String property,
String topiaId) |
void |
addTopiaIdNotIn(String property,
Collection<String> topiaIds) |
void |
addWhereClause(String whereClause) |
void |
addWhereClause(String whereClause,
Map<String,Object> hqlParameters) |
protected void |
doAddGreaterOrEquals(String property,
Object value) |
protected void |
doAddGreaterThan(String property,
Object value) |
protected void |
doAddLowerOrEquals(String property,
Object value) |
protected void |
doAddLowerThan(String property,
Object value) |
String |
getAlias() |
String |
getHql() |
String |
getHqlFromClause() |
String |
getHqlOrderByClause() |
Map<String,Object> |
getHqlParameters() |
String |
getHqlSelectClause() |
String |
getHqlWhereClause() |
protected String |
getParameterName(String propertyName)
Converts a (nested) property name to an HQL argument name.
|
Set<String> |
getWhereClauses() |
boolean |
isOrderByClausePresent() |
protected String |
putHqlParameterWithAvailableName(String propertyName,
Object value)
Add a parameter in the parameters map searching with the suitable parameter name in order to prevent conflicts.
|
void |
setAlias(String alias)
Deprecated.
use constructor, alias should not be changed
|
void |
setOrderByArguments(Collection<org.nuiton.util.pagination.PaginationOrder> paginationOrders) |
void |
setOrderByArguments(Set<String> orderByArguments) |
void |
setOrderByArguments(String... orderByArguments) |
void |
setParameters(Map<String,Object> parameters) |
void |
setSelectClause(String selectClause) |
void |
setWhereClauses(Set<String> whereClauses) |
String |
toString() |
protected com.google.common.base.Joiner hqlClausesJoiner
protected Class<E extends TopiaEntity> entityClass
protected String selectClause
protected String alias
@Deprecated public void setAlias(String alias)
public String getAlias()
public String getHqlSelectClause()
public void setSelectClause(String selectClause)
public void addNull(String property)
public void addNotNull(String property)
public void addIn(String property, Collection<?> values)
public void addNotIn(String property, Collection<?> values)
protected void addInOrNotIn(String property, Collection<?> values, boolean in)
in - true if property value must be in given collection, false if value must not be in given collectionpublic void addTopiaIdIn(String property, Collection<String> topiaIds)
public void addTopiaIdNotIn(String property, Collection<String> topiaIds)
public void addWhereClause(String whereClause)
public void addCollectionIsEmpty(String property)
public void addCollectionIsNotEmpty(String property)
public void setOrderByArguments(String... orderByArguments)
public void setOrderByArguments(Collection<org.nuiton.util.pagination.PaginationOrder> paginationOrders)
public String getHqlFromClause()
public String getHqlWhereClause()
public String getHqlOrderByClause()
public String getHql()
protected String getParameterName(String propertyName)
propertyName - the name of a property, can be a path to a nested propertyprotected String putHqlParameterWithAvailableName(String propertyName, Object value)
public boolean isOrderByClausePresent()
Copyright © 2004–2014 CodeLutin. All rights reserved.