Package org.neo4j.ogm.context
Class EntityGraphMapper
java.lang.Object
org.neo4j.ogm.context.EntityGraphMapper
- All Implemented Interfaces:
EntityMapper
Implementation of
EntityMapper
that is driven by an instance of MetaData
.- Author:
- Vince Bickers, Luanne Misquitta, Mark Angrish, Michael J. Simons
-
Constructor Summary
ConstructorDescriptionEntityGraphMapper
(MetaData metaData, MappingContext mappingContext) Constructs a newEntityGraphMapper
that uses the givenMetaData
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWriteProtection
(BiFunction<WriteProtectionTarget, Class<?>, Predicate<Object>> writeProtectionSupplier) Returns compile context after multipleEntityMapper.map(Object)
operations were calledProcesses the given object and any of its composite persistent objects and produces Cypher queries to persist their state in Neo4j.Processes the given object and any of its composite persistent objects to the specified depth and produces Cypher queries to persist their state in Neo4j.
-
Constructor Details
-
EntityGraphMapper
Constructs a newEntityGraphMapper
that uses the givenMetaData
.- Parameters:
metaData
- TheMetaData
containing the mapping informationmappingContext
- TheMappingContext
for the current session
-
-
Method Details
-
addWriteProtection
public void addWriteProtection(BiFunction<WriteProtectionTarget, Class<?>, Predicate<Object>> writeProtectionSupplier) -
map
Description copied from interface:EntityMapper
Processes the given object and any of its composite persistent objects and produces Cypher queries to persist their state in Neo4j. NOTE: multiple map calls from same EntityMapper instance return same CompileContext with accumulated results. You can also useEntityMapper.compileContext()
to get final CompileContext.- Specified by:
map
in interfaceEntityMapper
- Parameters:
entity
- The "root" node of the object graph to persist- Returns:
- A
CompileContext
object containing the statements required to persist the given object to Neo4j, along with a representation of the changes to be made by the Cypher statements nevernull
-
map
Description copied from interface:EntityMapper
Processes the given object and any of its composite persistent objects to the specified depth and produces Cypher queries to persist their state in Neo4j. NOTE: multiple map calls from same EntityMapper instance return same CompileContext with accumulated results. You can also useEntityMapper.compileContext()
to get final CompileContext.- Specified by:
map
in interfaceEntityMapper
- Parameters:
entity
- The "root" node of the object graph to persisthorizon
- The number of objects away from the "root" to traverse when looking for objects to map- Returns:
- A
CompileContext
object containing the statements required to persist the given object to Neo4j, along with a representation of the changes to be made by the Cypher statements nevernull
-
compileContext
Description copied from interface:EntityMapper
Returns compile context after multipleEntityMapper.map(Object)
operations were called- Specified by:
compileContext
in interfaceEntityMapper
- Returns:
- CompileContext
-