Annotation Interface ConvertWith
Neo4jPersistentPropertyConverter
and if needed, a custom factory to create that converter or the annotation
can be used to build custom meta-annotated annotations like @org.springframework.data.neo4j.core.support.DateLong
.
Custom conversions are applied to both attributes of entities and parameters of repository methods that map to those attributes (which does apply to all derived queries and queries by example but not to string based queries).
Converters that have a default constructor don't need a dedicated factory. A dedicated factory will be provided with either this annotation and its values or with the meta annotated annotation, including all configuration available.
In case converterRef()
is set to a non null and non-empty value, the mapping context
will try to lookup a bean under the given name of type Neo4jPersistentPropertyConverter
in the application context.
If no such bean is found an exception will be thrown. This attribute has precedence over converter()
.
- Since:
- 6.0
- Author:
- Michael J. Simons
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Indicates an unset converter. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends Neo4jPersistentPropertyConverter<?>>
Class<? extends Neo4jPersistentPropertyConverterFactory>
-
Element Details
-
converter
Class<? extends Neo4jPersistentPropertyConverter<?>> converter- Returns:
- The converter to instantiated for converting attributes to properties and vice versa.
- Default:
- org.springframework.data.neo4j.core.convert.ConvertWith.UnsetConverter.class
-
converterFactory
Class<? extends Neo4jPersistentPropertyConverterFactory> converterFactory- Returns:
- An alternative to
converter()
, for all the scenarios in which constructing a converter is more effort than a constructor call.
- Default:
- org.springframework.data.neo4j.core.convert.DefaultNeo4jPersistentPropertyConverterFactory.class
-
converterRef
String converterRef- Returns:
- An optional reference to a bean to be used as converter, must implement
Neo4jPersistentPropertyConverter
.
- Default:
- ""
-