Class AbstractRelationQueryAdapter
java.lang.Object
ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
ch.tocco.nice2.persist.core.impl.hibernate.pojo.relation.AbstractRelationQueryAdapter
- All Implemented Interfaces:
Query
,RelationQuery
- Direct Known Subclasses:
ToManyRelationQueryAdapter
,ToOneRelationQueryAdapter
public abstract class AbstractRelationQueryAdapter
extends AbstractOrderableQuery
implements RelationQuery
Abstract base class which maps hibernate collections to the
RelationQuery
interface-
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
AbstractRelationQueryAdapter
(Entity sourceEntity, RelationModel relationModel) -
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.Get the entity manager.getOnlyResult
(LockMode lockMode) @Nullable Entity
getOnlyResultOrNull
(LockMode lockMode) void
setParameter
(String name, Object value) Set a parameter for the query.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
appendOrder, count, firstResult, firstResultOrNull, getKeys, getKeys, getOnlyResult, getOnlyResultOrNull, getOrdering, hasOrdering, prependOrder, uniqueResult, uniqueResultOrNull, withOrder
Methods inherited from interface ch.tocco.nice2.persist.core.api.query.RelationQuery
execute
-
Field Details
-
sourceEntity
-
relationModel
-
-
Constructor Details
-
AbstractRelationQueryAdapter
-
-
Method Details
-
getSource
- Specified by:
getSource
in interfaceRelationQuery
-
getRelationModel
- Specified by:
getRelationModel
in interfaceRelationQuery
-
setParameter
Description copied from interface:Query
Set a parameter for the query.- Specified by:
setParameter
in interfaceQuery
- Parameters:
name
- The name of the parametervalue
- The value of the parameter in the correct data type.- Throws:
PersistException
- If the parameter cannot be set (invalid name, invalid value)
-
getManager
Description copied from interface:Query
Get the entity manager.- Specified by:
getManager
in interfaceQuery
- Returns:
- The entity manager.
-
execute
Description copied from interface:Query
Execute the query inQuery.Mode.LAZY
mode using the default limit.- Specified by:
execute
in interfaceQuery
- Specified by:
execute
in interfaceRelationQuery
- Returns:
- The result of the query. To further process it use the
EntityLists
class.
-
execute
Description copied from interface:Query
Execute the query using the specified pagination parameters inQuery.Mode.LAZY
mode.- Specified by:
execute
in interfaceQuery
- Specified by:
execute
in interfaceRelationQuery
- 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.- Specified by:
execute
in interfaceQuery
- Specified by:
execute
in interfaceRelationQuery
- Parameters:
mode
- The query mode.- Returns:
- The result of the query.
-
execute
Description copied from interface:Query
Execute the query using the specified limit inQuery.Mode.LAZY
mode.- Specified by:
execute
in interfaceQuery
- Specified by:
execute
in interfaceRelationQuery
- Parameters:
limit
- The maximum number of results, see class header (really).- Returns:
- The result of the query.
-
execute
Description copied from interface:Query
Execute the query using the specified limit in the specifiedQuery.Mode
.- Specified by:
execute
in interfaceQuery
- Specified by:
execute
in interfaceRelationQuery
- Parameters:
limit
- The maximum number of results, see class header (really).mode
- The mode.- Returns:
- The result of the query.
-
getOnlyResult
- Specified by:
getOnlyResult
in interfaceQuery
-
getOnlyResultOrNull
- Specified by:
getOnlyResultOrNull
in interfaceQuery
-
toQueryDefinition
- Specified by:
toQueryDefinition
in interfaceQuery
-