public class GraphEntityMapper extends Object implements ResponseMapper<GraphModel>
| Constructor and Description |
|---|
GraphEntityMapper(MetaData metaData,
MappingContext mappingContext,
EntityInstantiator entityInstantiator) |
| Modifier and Type | Method and Description |
|---|---|
void |
executePostLoad(Set<Long> nodeIds,
Set<Long> edgeIds)
Executes method annotated with @PostLoad on node and relationship entities with given ids
This method must be executed after processing all result rows:
- post load must be called after the entity is fully hydrated
- to avoid executing post load multiple times on same entity
|
<T> List<T> |
map(Class<T> type,
GraphModel graphModel,
Set<Long> nodeIds,
Set<Long> edgeIds)
Map graph model and return found entities of given type type
This method doesn't execute @PostLoad, call this method after processing whole request while accumulating
nodeIds and edgeIds.
|
<T> Iterable<T> |
map(Class<T> type,
Response<GraphModel> model)
Maps the data representation in the given response onto instances of
T. |
public GraphEntityMapper(MetaData metaData, MappingContext mappingContext, EntityInstantiator entityInstantiator)
public <T> Iterable<T> map(Class<T> type, Response<GraphModel> model)
ResponseMapperT.map in interface ResponseMapper<GraphModel>T - type of the resulttype - The Class defining the type to which each entities in the response should be mappedmodel - The Response object containing the data to map onto the objectsIterable of type T containing relevant data extracted from the responsepublic <T> List<T> map(Class<T> type, GraphModel graphModel, Set<Long> nodeIds, Set<Long> edgeIds)
T - typetype - class of entities to returngraphModel - graph model to mapnodeIds - accumulator for mapped nodeIdsedgeIds - accumulator for mapped edgeIdspublic void executePostLoad(Set<Long> nodeIds, Set<Long> edgeIds)
nodeIds - nodeIdsedgeIds - edgeIdsCopyright © 2018 Neo Technology, Inc.. All rights reserved.