Class EntityGraphMapper

java.lang.Object
org.neo4j.ogm.context.EntityGraphMapper
All Implemented Interfaces:
EntityMapper

public class EntityGraphMapper extends Object implements EntityMapper
Implementation of EntityMapper that is driven by an instance of MetaData.
Author:
Vince Bickers, Luanne Misquitta, Mark Angrish, Michael J. Simons
  • Constructor Details

  • Method Details

    • addWriteProtection

      public void addWriteProtection(BiFunction<WriteProtectionTarget,Class<?>,Predicate<Object>> writeProtectionSupplier)
    • map

      public CompileContext map(Object entity)
      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 use EntityMapper.compileContext() to get final CompileContext.
      Specified by:
      map in interface EntityMapper
      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 never null
    • map

      public CompileContext map(Object entity, int horizon)
      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 use EntityMapper.compileContext() to get final CompileContext.
      Specified by:
      map in interface EntityMapper
      Parameters:
      entity - The "root" node of the object graph to persist
      horizon - 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 never null
    • compileContext

      public CompileContext compileContext()
      Description copied from interface: EntityMapper
      Returns compile context after multiple EntityMapper.map(Object) operations were called
      Specified by:
      compileContext in interface EntityMapper
      Returns:
      CompileContext