Class AbstractHibernateQueryAdapter
java.lang.Object
ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractHibernateQueryAdapter
- All Implemented Interfaces:
Query
- Direct Known Subclasses:
EmptyQuery
,HibernateQueryAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.query.Query
Query.Mode
-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
ordering
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractHibernateQueryAdapter
(EntityManager entityManager) -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Execute the query inQuery.Mode.LAZY
mode using the default limit.execute
(int limit) Execute the query using the specified limit inQuery.Mode.LAZY
mode.execute
(int limit, Query.Mode mode) Execute the query using the specified limit in the specifiedQuery.Mode
.execute
(Pagination pagination) Execute the query using the specified pagination parameters inQuery.Mode.LAZY
mode.execute
(Query.Mode mode) Execute the query in the specifiedQuery.Mode
using the default limit.Executes and returns the first selected Entity by this query, or throws.@Nullable Entity
Executes and returns the first selected Entity by this query, or null if none.Get the entity manager.Executes and returns the single selected Entity by this query, or throws.getOnlyResult
(LockMode lockMode) @Nullable Entity
Executes and returns the single selected Entity by this query, or null if none, or throws.Executes and returns the single selected Entity by this query, or throws.@Nullable Entity
Executes and returns the single selected Entity by this query, or null if none, or throws.Methods inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
appendOrder, getOrdering, hasOrdering, prependOrder, withOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.query.Query
count, execute, getKeys, getKeys, getOnlyResultOrNull, setParameter, toQueryDefinition
-
Field Details
-
entityManager
-
-
Constructor Details
-
AbstractHibernateQueryAdapter
-
-
Method Details
-
execute
Description copied from interface:Query
Execute the query inQuery.Mode.LAZY
mode using the default limit.- Returns:
- The result of the query. To further process it use the
EntityLists
class. - Throws:
PersistException
- If an error occurs
-
execute
Description copied from interface:Query
Execute the query using the specified pagination parameters inQuery.Mode.LAZY
mode.- Parameters:
pagination
- The offset and limit of the query.- Returns:
- The result of the query.
-
execute
Description copied from interface:Query
Execute the query in the specifiedQuery.Mode
using the default limit.- Parameters:
mode
- The query mode.- Returns:
- The result of the query.
- Throws:
PersistException
- If an error occurs
-
execute
Description copied from interface:Query
Execute the query using the specified limit inQuery.Mode.LAZY
mode.- Parameters:
limit
- The maximum number of results, see class header (really).- Returns:
- The result of the query.
- Throws:
PersistException
- If an error occurred.
-
execute
Description copied from interface:Query
Execute the query using the specified limit in the specifiedQuery.Mode
.- Parameters:
limit
- The maximum number of results, see class header (really).mode
- The mode.- Returns:
- The result of the query.
- Throws:
PersistException
- If an error occurred.
-
uniqueResult
Description copied from interface:Query
Executes and returns the single selected Entity by this query, or throws.- Returns:
- The single selected Entity.
- Throws:
PersistException
- See Also:
-
uniqueResultOrNull
Description copied from interface:Query
Executes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or
null
if none. - Throws:
PersistException
- See Also:
-
getOnlyResult
-
getOnlyResultOrNull
Description copied from interface:Query
Executes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or
null
if none. - See Also:
-
firstResult
Description copied from interface:Query
Executes and returns the first selected Entity by this query, or throws.- Returns:
- The first selected Entity.
- Throws:
PersistException
- See Also:
-
firstResultOrNull
Description copied from interface:Query
Executes and returns the first selected Entity by this query, or null if none.- Returns:
- The first selected Entity, or
null
if none. - Throws:
PersistException
- If an error occurred.- See Also:
-
getOnlyResult
Description copied from interface:Query
Executes and returns the single selected Entity by this query, or throws.- Returns:
- The single selected Entity.
- See Also:
-
getManager
Description copied from interface:Query
Get the entity manager.- Returns:
- The entity manager.
-