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
FieldsModifier and TypeFieldDescriptionprotected final List<QueryBuilderInterceptor> protected final EntityModelprotected final com.google.common.collect.Multimap<String, QueryBuilderInterceptor.SelectionInterceptor> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractToOneBinaryHandler(EntityModel rootModel, List<QueryBuilderInterceptor> interceptors) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Map<Serializable, BinaryData> loadBinaryData(Path path, List<Serializable> keys) <RT> voidprocessResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.voidprocessSelection(SelectionRegistry selectionRegistry) This is called before the query is executed.voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
selectin interfaceSelectionPathHandler- Parameters:
path- a path that should be selected by this handler.
-
processSelection
Description copied from interface:SelectionPathHandlerThis is called before the query is executed. The handler can add all required selection paths to the givenSelectionRegistry.- Specified by:
processSelectionin interfaceSelectionPathHandler
-
processResults
public <RT> void processResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) Description copied from interface:SelectionPathHandlerThis 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:
processResultsin 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
-