public class HqlAndParametersBuilder<E extends TopiaEntity> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
alias |
protected Class<E> |
entityClass |
protected Set<String> |
fetchProperties |
protected com.google.common.base.Joiner |
hqlClausesJoiner |
protected LinkedHashSet<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 |
addAllFetches(Collection<String> properties) |
void |
addAllFetches(String property,
String... otherProperties) |
void |
addCollectionIsEmpty(String property) |
void |
addCollectionIsNotEmpty(String property) |
void |
addContains(String property,
Object value) |
void |
addEquals(String property,
Object value) |
void |
addFetch(String property) |
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 |
getHqlForFetchStep1() |
String |
getHqlForFetchStep2() |
protected String |
getHqlFromClause(boolean includeFetch) |
String |
getHqlOrderByClause() |
Map<String,Object> |
getHqlParameters() |
String |
getHqlSelectClause(boolean includeFetch) |
String |
getHqlWhereClause() |
protected String |
getParameterName(String propertyName)
Converts a (nested) property name to an HQL argument name.
|
Set<String> |
getWhereClauses() |
boolean |
hasFetchProperties() |
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(LinkedHashSet<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
protected LinkedHashSet<String> orderByArguments
@Deprecated public void setAlias(String alias)
alias - FIXMEpublic String getAlias()
public String getHqlSelectClause(boolean includeFetch)
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)
property - FIXMEvalues - FIXMEin - true if property value must be in given collection, false if value must not be in given collectionpublic void addTopiaIdEquals(String property, String topiaId)
property - FIXMEtopiaId - FIXMETopiaQueryBuilderAddCriteriaStep.addTopiaIdEquals(String, String)public void addTopiaIdIn(String property, Collection<String> topiaIds)
property - FIXMEtopiaIds - FIXMETopiaQueryBuilderAddCriteriaStep.addTopiaIdIn(String, java.util.Collection)public void addTopiaIdNotEquals(String property, String topiaId)
property - FIXMEtopiaId - FIXMETopiaQueryBuilderAddCriteriaStep.addTopiaIdNotEquals(String, String)public void addTopiaIdNotIn(String property, Collection<String> topiaIds)
property - FIXMEtopiaIds - FIXMETopiaQueryBuilderAddCriteriaStep.addTopiaIdNotIn(String, java.util.Collection)public void addWhereClause(String whereClause)
public void addCollectionIsEmpty(String property)
public void addCollectionIsNotEmpty(String property)
public void setOrderByArguments(LinkedHashSet<String> orderByArguments)
public void setOrderByArguments(String... orderByArguments)
public void setOrderByArguments(Collection<org.nuiton.util.pagination.PaginationOrder> paginationOrders)
public void addAllFetches(Collection<String> properties)
public void addFetch(String property)
public boolean hasFetchProperties()
protected String getHqlFromClause(boolean includeFetch)
public String getHqlWhereClause()
public String getHqlOrderByClause()
public String getHql()
public String getHqlForFetchStep1()
public String getHqlForFetchStep2()
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)
propertyName - FIXMEvalue - FIXMEpublic boolean isOrderByClausePresent()
Copyright © 2004–2018 CodeLutin. All rights reserved.