Class AbstractToManyBinaryHandler
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandler
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.binary.AbstractToManyBinaryHandler
- All Implemented Interfaces:
SelectionPathHandler
- Direct Known Subclasses:
ToManyDetailDocumentHandler
,ToManyResourceContentHandler
Abstract
SelectionPathHandler
for all to-many fields of type binary.
Only the associated primary key of the entity (Resource_content or the related entity if it's an entity doc)
is queried from the database.
The BinaryDataAccessor
is then used to efficiently query all necessary data based on the retrieved
primary keys.-
Nested Class Summary
Nested classes/interfaces inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandler
AbstractToManySelectionPathHandler.QueryHolder
-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandler
criteriaBuilder, dataModel, fieldResolver, interceptors, parameterProviders, paths, predicateFactory, queries, rootKeyName, rootModel, selectionInterceptorMap, session, typeManager
-
Constructor Summary
ConstructorDescriptionAbstractToManyBinaryHandler
(DataModel dataModel, TypeManager typeManager, FieldResolver fieldResolver, EntityModel rootModel, PredicateFactory predicateFactory, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Map
<Serializable, BinaryData> loadBinaryData
(Path path, List<Serializable> allKeys) protected void
processAdditionalQuery
(AbstractToManySelectionPathHandler.QueryHolder queryHolder, List<Path> paths) <RT> void
processResults
(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.void
Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandler
doLoadData, extractAllRootPrimaryKeys, processSelection
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.impl.hibernate.query.selection.SelectionPathHandler
supports
-
Constructor Details
-
AbstractToManyBinaryHandler
public AbstractToManyBinaryHandler(DataModel dataModel, TypeManager typeManager, FieldResolver fieldResolver, EntityModel rootModel, PredicateFactory predicateFactory, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder)
-
-
Method Details
-
select
- Parameters:
path
- a path that should be selected by this handler.
-
processAdditionalQuery
protected void processAdditionalQuery(AbstractToManySelectionPathHandler.QueryHolder queryHolder, List<Path> paths) - Specified by:
processAdditionalQuery
in classAbstractToManySelectionPathHandler
-
processResults
public <RT> void processResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) Description copied from interface:SelectionPathHandler
This is called after the query was executed. The handler is expected to map the query results to the target array that is returned from the query builder.- Parameters:
queryResults
- the query result, contains all paths added duringSelectionPathHandler.processSelection(SelectionRegistry)
target
- the list of arrays that will be returned from the query builder
-
loadBinaryData
protected abstract Map<Serializable,BinaryData> loadBinaryData(Path path, List<Serializable> allKeys)
-