|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.common.util.dao.TypedQueryBuilder<T>
T - the class that is being queried forpublic class TypedQueryBuilder<T>
Utility class to construct typed query-language queries. This has an advantage over CriteriaQuery in that it will be automatically responsive to polymorphism thanks to Hibernate's handling of query-language strings.
| Field Summary | |
|---|---|
protected Map<String,Object> |
paramMap
|
protected List<TQRestriction> |
restrictions
|
protected String |
rootAlias
|
protected Class<T> |
rootClass
|
| Constructor Summary | |
|---|---|
TypedQueryBuilder(Class<T> rootClass,
String rootAlias)
Creates a new TypedQueryBuilder that will utilize the rootAlias as the named object of the class |
|
| Method Summary | |
|---|---|
TypedQueryBuilder<T> |
addRestriction(String expression,
String operation,
Object parameter)
Adds a simple restriction to the query. |
TypedQueryBuilder<T> |
addRestriction(TQRestriction restriction)
Adds an explicit TQRestriction object. |
Map<String,Object> |
getParamMap()
|
javax.persistence.TypedQuery<T> |
toQuery(javax.persistence.EntityManager em)
Returns a TypedQuery that represents this builder object. |
String |
toQueryString()
Generates the query string based on the current contents of this builder. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<T> rootClass
protected String rootAlias
protected List<TQRestriction> restrictions
protected Map<String,Object> paramMap
| Constructor Detail |
|---|
public TypedQueryBuilder(Class<T> rootClass,
String rootAlias)
rootClass - rootAlias - | Method Detail |
|---|
public TypedQueryBuilder<T> addRestriction(String expression,
String operation,
Object parameter)
expression - operation - parameter - public TypedQueryBuilder<T> addRestriction(TQRestriction restriction)
restriction -
public String toQueryString()
toQuery(EntityManager),
which will automatically generate the TypedQuery and populate the required parameters.
public javax.persistence.TypedQuery<T> toQuery(javax.persistence.EntityManager em)
em -
public Map<String,Object> getParamMap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||