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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe default implementation, passing map properties through as they are on the way to the graph and possibly applying a post processor on the way out of the graph.static final classThe default operation for transforming the keys.static enumPhase of the mapping currently taking place. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends Neo4jPersistentPropertyToMapConverter> Defines a dedicated converter for this field.Allows to specify the delimiter between prefix and map value on the properties of the node or relationship in the graph.Allows to specify the prefix for the map properties.Class<? extends BiFunction<CompositeProperty.Phase, String, String>> This attribute allows for configuring a transformation that is applied to the maps keys.
-
Element Details
-
converter
@AliasFor(annotation=ConvertWith.class, value="converter") Class<? extends Neo4jPersistentPropertyToMapConverter> converterDefines a dedicated converter for this field.- 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
- Default:
""
-
prefix
String prefixAllows 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 delimiterAllows 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>> transformKeysWithThis attribute allows for configuring a transformation that is applied to the maps keys.CompositeProperty.Phase.WRITEis applied before writing the map,CompositeProperty.Phase.READis applied on write.- Returns:
- A transformation to be used on enum keys.
- Default:
org.springframework.data.neo4j.core.schema.CompositeProperty.NoopTransformation.class
-