|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.elca.el4j.services.persistence.jpa.util.JpaQuery<T>
T
- The type parameter.public class JpaQuery<T>
Query object returned by DataService.
Nested Class Summary | |
---|---|
static class |
JpaQuery.Order
Order of a sort. |
static class |
JpaQuery.Relation
The possible relations (eq, neq ...). |
Constructor Summary | |
---|---|
JpaQuery(Class<T> cls,
JpaHelperImpl ds)
Create the query object. |
Method Summary | |
---|---|
JpaQuery<T> |
detach()
Detach all returned elements. |
List<T> |
execute()
Execute the query. |
List<T> |
executeHQL(String query,
Object... params)
Execute a HQL query. |
T |
executeHQLUnique(String query,
Object... params)
Execute HQL and epxect a single item. |
T |
executeUnique()
Execute the query, expecting a unique element. |
JpaQuery<T> |
extent(String... names)
Add a data extent (a property to be eagerly fetched). |
JpaQuery<T> |
failOnNull()
Fail if no elements are returned. |
JpaQuery<T> |
order(String key,
JpaQuery.Order order)
Add an order. |
JpaQuery<T> |
where(Criterion c)
Add a hibernate criterion. |
JpaQuery<T> |
where(String key,
JpaQuery.Relation r,
Object value)
Add a restriction. |
JpaQuery<T> |
where(String key,
Object value)
Add a restriction. |
JpaQuery<T> |
whereNotNull(String key)
Add an is--not-null restriction. |
JpaQuery<T> |
whereNull(String key)
Add an is-null restriction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpaQuery(Class<T> cls, JpaHelperImpl ds)
cls
- The class to query for.context
- The context.ds
- The data service.Method Detail |
---|
public JpaQuery<T> where(String key, Object value)
key
- The property name.value
- The property value.
public JpaQuery<T> where(Criterion c)
c
- The criterion.
public JpaQuery<T> where(String key, JpaQuery.Relation r, Object value)
key
- The property name.r
- The relation type.value
- The property value.
public JpaQuery<T> whereNull(String key)
key
- The property name.
public JpaQuery<T> whereNotNull(String key)
key
- The property name.
public JpaQuery<T> order(String key, JpaQuery.Order order)
key
- The property to order by.order
- The order to use.
public JpaQuery<T> extent(String... names)
names
- The names of the properties to fetch.
public JpaQuery<T> failOnNull()
public JpaQuery<T> detach()
public List<T> execute()
public T executeUnique()
public List<T> executeHQL(String query, Object... params)
query
- The query string.params
- The parameters.
public T executeHQLUnique(String query, Object... params)
query
- The query string.params
- The parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |