Class AbstractToOneBinaryHandler
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.binary.AbstractToOneBinaryHandler
- All Implemented Interfaces:
SelectionPathHandler
- Direct Known Subclasses:
ToOneDetailDocumentHandler
,ToOneResourceContentHandler
Abstract
SelectionPathHandler
for all to-one 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.-
Field Summary
Modifier and TypeFieldDescriptionprotected final List
<QueryBuilderInterceptor> protected final EntityModel
protected final com.google.common.collect.Multimap
<String, QueryBuilderInterceptor.SelectionInterceptor> -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractToOneBinaryHandler
(EntityModel rootModel, List<QueryBuilderInterceptor> interceptors) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Map
<Serializable, BinaryData> loadBinaryData
(Path path, List<Serializable> keys) <RT> void
processResults
(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.void
processSelection
(SelectionRegistry selectionRegistry) This is called before the query is executed.void
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
-
Field Details
-
rootModel
-
pathToPk
-
interceptors
-
paths
-
selectionInterceptorMap
protected final com.google.common.collect.Multimap<String,QueryBuilderInterceptor.SelectionInterceptor> selectionInterceptorMap
-
-
Constructor Details
-
AbstractToOneBinaryHandler
protected AbstractToOneBinaryHandler(EntityModel rootModel, List<QueryBuilderInterceptor> interceptors)
-
-
Method Details
-
select
- Specified by:
select
in interfaceSelectionPathHandler
- Parameters:
path
- a path that should be selected by this handler.
-
processSelection
Description copied from interface:SelectionPathHandler
This is called before the query is executed. The handler can add all required selection paths to the givenSelectionRegistry
.- Specified by:
processSelection
in interfaceSelectionPathHandler
-
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.- Specified by:
processResults
in interfaceSelectionPathHandler
- 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
-