@API(status=STABLE,
since="6.0")
public interface Schema
Modifier and Type | Method and Description |
---|---|
Neo4jConverter |
getConverter() |
<T extends IdGenerator<?>> |
getIdGenerator(String reference) |
NodeDescription<?> |
getNodeDescription(Class<?> underlyingClass)
Retrieves a nodes description by its underlying class.
|
NodeDescription<?> |
getNodeDescription(String primaryLabel)
Retrieves a nodes description by its primary label.
|
<T extends IdGenerator<?>> |
getOrCreateIdGeneratorOfType(Class<T> idGeneratorType)
Creates or retrieves an instance of the given id generator class.
|
default <T> Function<T,Map<String,Object>> |
getRequiredBinderFunctionFor(Class<T> sourceClass) |
default <T> BiFunction<org.neo4j.driver.types.TypeSystem,org.neo4j.driver.Record,T> |
getRequiredMappingFunctionFor(Class<T> targetClass)
Retrieves a schema based mapping function for the
targetClass . |
default NodeDescription<?> |
getRequiredNodeDescription(Class<?> underlyingClass) |
default NodeDescription<?> |
getRequiredNodeDescription(String primaryLabel) |
void |
initialize()
Triggers the scanning of the registered, initial entity set.
|
void |
setInitialEntitySet(Set<? extends Class<?>> initialEntitySet)
Registers the given set of classes to be available as Neo4j domain entities.
|
void setInitialEntitySet(Set<? extends Class<?>> initialEntitySet)
initialEntitySet
- The set of classes to register with this schemavoid initialize()
@Nullable NodeDescription<?> getNodeDescription(String primaryLabel)
primaryLabel
- The primary label under which the node is described@Nullable NodeDescription<?> getNodeDescription(Class<?> underlyingClass)
underlyingClass
- The underlying class of the node description to be retrieveddefault NodeDescription<?> getRequiredNodeDescription(Class<?> underlyingClass)
default NodeDescription<?> getRequiredNodeDescription(String primaryLabel)
default <T> BiFunction<org.neo4j.driver.types.TypeSystem,org.neo4j.driver.Record,T> getRequiredMappingFunctionFor(Class<T> targetClass)
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.
T
- Type of the target classtargetClass
- The target class to which to map to.UnknownEntityException
- When targetClass
is not a managed classNeo4jConverter getConverter()
default <T> Function<T,Map<String,Object>> getRequiredBinderFunctionFor(Class<T> sourceClass)
<T extends IdGenerator<?>> T getOrCreateIdGeneratorOfType(Class<T> idGeneratorType)
idGeneratorType
- The type of the ID generator to return<T extends IdGenerator<?>> Optional<T> getIdGenerator(String reference)
Copyright © 2019–2020 Neo4j, Neo4j Sweden AB. All rights reserved.