Interface Neo4jPersistentPropertyToMapConverter<K,P>

Type Parameters:
K - The type of the keys (Only Strings and Enums are supported).
P - The type of the property.
All Known Implementing Classes:
CompositeProperty.DefaultToMapConverter

@API(status=STABLE, since="6.0") public interface Neo4jPersistentPropertyToMapConverter<K,P>
You need to provide an implementation of this interface in case you want to store a property of an entity as separate properties on a node. The entity needs to be decomposed into a map and composed from a map for that purpose.

The calling mechanism will take care of adding and removing configured prefixes and transforming keys and values into something that Neo4j can understand.

Since:
6.0
Author:
Michael J. Simons
  • Method Summary

    Modifier and Type
    Method
    Description
    compose(Map<K,org.neo4j.driver.Value> source, Neo4jConversionService neo4jConversionService)
    Composes the object back from the map.
    Map<K,org.neo4j.driver.Value>
    decompose(P property, Neo4jConversionService neo4jConversionService)
    Decomposes an object into a map.
  • Method Details

    • decompose

      Map<K,org.neo4j.driver.Value> decompose(@Nullable P property, Neo4jConversionService neo4jConversionService)
      Decomposes an object into a map. A conversion service is provided in case delegation is needed.
      Parameters:
      property - The source property
      neo4jConversionService - The conversion service to delegate to if necessary
      Returns:
      The decomposed object.
    • compose

      P compose(Map<K,org.neo4j.driver.Value> source, Neo4jConversionService neo4jConversionService)
      Composes the object back from the map. The map contains the raw driver values, as SDN cannot know how you want to handle them. Therefore, the conversion service to convert driver values is provided.
      Parameters:
      source - The source map
      neo4jConversionService - The conversion service in case you want to delegate the work for some values in the map
      Returns:
      The composed object.