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
FieldsFields inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
ordering -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRelationQueryAdapter(Entity sourceEntity, RelationModel relationModel) -
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.Get the entity manager.getOnlyResult(LockMode lockMode) @Nullable EntitygetOnlyResultOrNull(LockMode lockMode) voidsetParameter(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, 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
appendOrder, count, firstResult, firstResultOrNull, getKeys, getKeys, getOnlyResult, getOnlyResultOrNull, getOrdering, hasOrdering, prependOrder, uniqueResult, uniqueResultOrNull, withOrderMethods inherited from interface ch.tocco.nice2.persist.core.api.query.RelationQuery
execute
-
Field Details
-
sourceEntity
-
relationModel
-
-
Constructor Details
-
AbstractRelationQueryAdapter
-
-
Method Details
-
getSource
- Specified by:
getSourcein interfaceRelationQuery
-
getRelationModel
- Specified by:
getRelationModelin interfaceRelationQuery
-
setParameter
Description copied from interface:QuerySet a parameter for the query.- Specified by:
setParameterin 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:QueryGet the entity manager.- Specified by:
getManagerin interfaceQuery- Returns:
- The entity manager.
-
execute
Description copied from interface:QueryExecute the query inQuery.Mode.LAZYmode using the default limit.- Specified by:
executein interfaceQuery- Specified by:
executein interfaceRelationQuery- Returns:
- The result of the query. To further process it use the
EntityListsclass.
-
execute
Description copied from interface:QueryExecute the query using the specified pagination parameters inQuery.Mode.LAZYmode.- Specified by:
executein interfaceQuery- Specified by:
executein interfaceRelationQuery- 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.- Specified by:
executein interfaceQuery- Specified by:
executein interfaceRelationQuery- Parameters:
mode- The query mode.- Returns:
- The result of the query.
-
execute
Description copied from interface:QueryExecute the query using the specified limit inQuery.Mode.LAZYmode.- Specified by:
executein interfaceQuery- Specified by:
executein interfaceRelationQuery- Parameters:
limit- The maximum number of results, see class header (really).- Returns:
- The result of the query.
-
execute
Description copied from interface:QueryExecute the query using the specified limit in the specifiedQuery.Mode.- Specified by:
executein interfaceQuery- Specified by:
executein interfaceRelationQuery- Parameters:
limit- The maximum number of results, see class header (really).mode- The mode.- Returns:
- The result of the query.
-
getOnlyResult
- Specified by:
getOnlyResultin interfaceQuery
-
getOnlyResultOrNull
- Specified by:
getOnlyResultOrNullin interfaceQuery
-
toQueryDefinition
- Specified by:
toQueryDefinitionin interfaceQuery
-