Annotation Interface CompositeProperty


@Retention(RUNTIME) @Target(FIELD) @Inherited @ConvertWith(converterFactory=org.springframework.data.neo4j.core.schema.CompositePropertyConverterFactory.class) @API(status=STABLE, since="6.0") public @interface CompositeProperty
This annotation indicates a persistent property that is composed of multiple properties on a node or relationship. The properties must share a common prefix. SDN defaults to the name of the field declared on the persistent entity.

This annotation is mainly to be used on properties of type Map<String, Object>. All values in the map are subject to conversions by other registered converters. Nested maps are not supported.

This annotation is the pendant to Neo4j-OGMs org.neo4j.ogm.annotation.Properties.

Since:
6.0
Author:
Michael J. Simons
  • Element Details

    • converter

      Returns:
      A converter that allows to store arbitrary objects as decomposed maps on nodes and relationships. The default converter allows only maps as composite properties.
      Default:
      org.springframework.data.neo4j.core.schema.CompositeProperty.DefaultToMapConverter.class
    • converterRef

      @AliasFor(annotation=ConvertWith.class, value="converterRef") String converterRef
      Default:
      ""
    • prefix

      String prefix
      Allows to specify the prefix for the map properties. The default empty value instructs SDN to use the field name of the annotated property.
      Returns:
      The prefix used for storing the properties in the graph on the node or relationship
      Default:
      ""
    • delimiter

      String delimiter
      Allows to specify the delimiter between prefix and map value on the properties of the node or relationship in the graph. Defaults to ..
      Returns:
      Delimiter to use in the stored property names
      Default:
      "."
    • transformKeysWith

      Class<? extends BiFunction<CompositeProperty.Phase,String,String>> transformKeysWith
      This attribute allows for configuring a transformation that is applied to the maps keys. CompositeProperty.Phase.WRITE is applied before writing the map, CompositeProperty.Phase.READ is applied on write.
      Returns:
      A transformation to be used on enum keys.
      Default:
      org.springframework.data.neo4j.core.schema.CompositeProperty.NoopTransformation.class