Interface EntityMapper

All Known Implementing Classes:
EntityGraphMapper

public interface EntityMapper
Specification for an object-graph mapper, which can map arbitrary Java objects onto Cypher data manipulation queries.
Author:
Adam George
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns compile context after multiple map(Object) operations were called
    map(Object entity)
    Processes the given object and any of its composite persistent objects and produces Cypher queries to persist their state in Neo4j.
    map(Object entity, int depth)
    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.
  • Method Details

    • map

      CompileContext map(Object entity)
      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 compileContext() to get final CompileContext.
      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
      Throws:
      NullPointerException - if invoked with null
    • map

      CompileContext map(Object entity, int depth)
      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 compileContext() to get final CompileContext.
      Parameters:
      entity - The "root" node of the object graph to persist
      depth - 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
      Throws:
      NullPointerException - if invoked with null
    • compileContext

      CompileContext compileContext()
      Returns compile context after multiple map(Object) operations were called
      Returns:
      CompileContext