DATAGRAPH-1377 - Add unknown entities to mapping context when called from templates.
This commit is contained in:
@@ -378,6 +378,7 @@ public final class Neo4jTemplate implements Neo4jOperations, BeanFactoryAware {
|
||||
private <T> ExecutableQuery<T> createExecutableQuery(Class<T> domainType, String cypherStatement,
|
||||
Map<String, Object> parameters) {
|
||||
|
||||
Assert.notNull(neo4jMappingContext.getPersistentEntity(domainType), "Cannot get or create persistent entity.");
|
||||
PreparedQuery<T> preparedQuery = PreparedQuery.queryFor(domainType).withCypherQuery(cypherStatement)
|
||||
.withParameters(parameters).usingMappingFunction(neo4jMappingContext.getRequiredMappingFunctionFor(domainType))
|
||||
.build();
|
||||
|
||||
@@ -374,6 +374,7 @@ public final class ReactiveNeo4jTemplate implements ReactiveNeo4jOperations, Bea
|
||||
private <T> Mono<ExecutableQuery<T>> createExecutableQuery(Class<T> domainType, String cypherQuery,
|
||||
Map<String, Object> parameters) {
|
||||
|
||||
Assert.notNull(neo4jMappingContext.getPersistentEntity(domainType), "Cannot get or create persistent entity.");
|
||||
PreparedQuery<T> preparedQuery = PreparedQuery.queryFor(domainType).withCypherQuery(cypherQuery)
|
||||
.withParameters(parameters)
|
||||
.usingMappingFunction(this.neo4jMappingContext.getRequiredMappingFunctionFor(domainType)).build();
|
||||
|
||||
@@ -405,7 +405,7 @@ final class DefaultNeo4jConverter implements Neo4jConverter {
|
||||
Map<Object, Object> relationshipsAndProperties = new HashMap<>();
|
||||
|
||||
// if the list is null the mapping is based on a custom query
|
||||
if (list == Values.NULL) {
|
||||
if (Values.NULL.equals(list)) {
|
||||
|
||||
Predicate<Value> isList = entry -> entry instanceof Value && typeSystem.LIST().isTypeOf(entry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user