All Known Implementing Classes:
Neo4jMappingContext

@API(status=INTERNAL, since="6.0") public interface Schema
Contains the descriptions of all nodes, their properties and relationships known to SDN.
Since:
6.0
Author:
Michael J. Simons
  • Method Details

    • getNodeDescription

      @Nullable NodeDescription<?> getNodeDescription(String primaryLabel)
      Retrieves a node's description by its primary label.
      Parameters:
      primaryLabel - The primary label under which the node is described
      Returns:
      The description if any, null otherwise
    • getNodeDescription

      @Nullable NodeDescription<?> getNodeDescription(Class<?> underlyingClass)
      Retrieves a node's description by its underlying class.
      Parameters:
      underlyingClass - The underlying class of the node description to be retrieved
      Returns:
      The description if any, null otherwise
    • getRequiredNodeDescription

      default NodeDescription<?> getRequiredNodeDescription(Class<?> underlyingClass)
    • getRequiredNodeDescription

      default NodeDescription<?> getRequiredNodeDescription(String primaryLabel)
    • getRequiredMappingFunctionFor

      default <T> BiFunction<org.neo4j.driver.types.TypeSystem,org.neo4j.driver.types.MapAccessor,T> getRequiredMappingFunctionFor(Class<T> targetClass)
      Retrieves a schema based mapping function for the targetClass. The mapping function will expect a record containing all the nodes and relationships necessary to fully populate an instance of the given class. It will not try to fetch data from any other records or queries. The mapping function is free to throw a RuntimeException, most likely a org.springframework.data.mapping.MappingException or IllegalStateException when mapping is not possible.

      In case the mapping function returns a null, the Neo4j client will throw an exception and prevent further processing.

      Type Parameters:
      T - Type of the target class
      Parameters:
      targetClass - The target class to which to map to.
      Returns:
      The default, stateless and reusable mapping function for the given target class
      Throws:
      UnknownEntityException - When targetClass is not a managed class
    • getEntityConverter

      Neo4jEntityConverter getEntityConverter()
      Returns:
      The (reading and writing) converter used to read records into entities and write entities into maps.
    • getRequiredBinderFunctionFor

      default <T> Function<T,Map<String,Object>> getRequiredBinderFunctionFor(Class<T> sourceClass)
    • getOrCreateIdGeneratorOfType

      <T extends IdGenerator<?>> T getOrCreateIdGeneratorOfType(Class<T> idGeneratorType)
      Creates or retrieves an instance of the given id generator class. During the lifetime of the schema, this method returns the same instance of reoccurring requests of the same type.
      Parameters:
      idGeneratorType - The type of the ID generator to return
      Returns:
      The id generator.
    • getIdGenerator

      <T extends IdGenerator<?>> Optional<T> getIdGenerator(String reference)