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
FieldsFields inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
ordering -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractHibernateQueryAdapter(EntityManager entityManager) -
Method Summary
Modifier and TypeMethodDescriptionexecute()Execute the query inQuery.Mode.LAZYmode using the default limit.execute(int limit) Execute the query using the specified limit inQuery.Mode.LAZYmode.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.LAZYmode.execute(Query.Mode mode) Execute the query in the specifiedQuery.Modeusing the default limit.Executes and returns the first selected Entity by this query, or throws.@Nullable EntityExecutes 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 EntityExecutes 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 EntityExecutes 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, withOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:QueryExecute the query inQuery.Mode.LAZYmode using the default limit.- Returns:
- The result of the query. To further process it use the
EntityListsclass. - Throws:
PersistException- If an error occurs
-
execute
Description copied from interface:QueryExecute the query using the specified pagination parameters inQuery.Mode.LAZYmode.- Parameters:
pagination- The offset and limit of the query.- Returns:
- The result of the query.
-
execute
Description copied from interface:QueryExecute the query in the specifiedQuery.Modeusing 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:QueryExecute the query using the specified limit inQuery.Mode.LAZYmode.- 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:QueryExecute 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:QueryExecutes 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:QueryExecutes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or
nullif none. - Throws:
PersistException- See Also:
-
getOnlyResult
-
getOnlyResultOrNull
Description copied from interface:QueryExecutes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or
nullif none. - See Also:
-
firstResult
Description copied from interface:QueryExecutes 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:QueryExecutes and returns the first selected Entity by this query, or null if none.- Returns:
- The first selected Entity, or
nullif none. - Throws:
PersistException- If an error occurred.- See Also:
-
getOnlyResult
Description copied from interface:QueryExecutes and returns the single selected Entity by this query, or throws.- Returns:
- The single selected Entity.
- See Also:
-
getManager
Description copied from interface:QueryGet the entity manager.- Returns:
- The entity manager.
-