Skip to content

Commit 55337de

Browse files
committed
Move off deprecated methods of PersistenPropertyPath.
Fixes #2705.
1 parent c31bd5d commit 55337de

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/org/springframework/data/neo4j/repository/query/CypherQueryCreator.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private QueryFragments createQueryFragments(@Nullable Condition condition, Sort
264264
private Condition createImpl(Part part, Iterator<Object> actualParameters) {
265265

266266
PersistentPropertyPath<Neo4jPersistentProperty> path = mappingContext.getPersistentPropertyPath(part.getProperty());
267-
Neo4jPersistentProperty property = path.getRequiredLeafProperty();
267+
Neo4jPersistentProperty property = path.getLeafProperty();
268268

269269
boolean ignoreCase = ignoreCase(part);
270270

@@ -327,7 +327,7 @@ private Condition containingCondition(PersistentPropertyPath<Neo4jPersistentProp
327327
Expression cypherProperty = toCypherProperty(path, ignoreCase);
328328

329329
if (property.isDynamicLabels()) {
330-
Neo4jPersistentProperty leafProperty = path.getRequiredLeafProperty();
330+
Neo4jPersistentProperty leafProperty = path.getLeafProperty();
331331
Neo4jPersistentEntity<?> owner = (Neo4jPersistentEntity<?>) leafProperty.getOwner();
332332
String containerName = getContainerName(path, owner);
333333
return toCypherParameter(nextRequiredParameter(actualParameters, property), ignoreCase)
@@ -381,7 +381,7 @@ private Condition betweenCondition(PersistentPropertyPath<Neo4jPersistentPropert
381381

382382
private Condition createNearCondition(PersistentPropertyPath<Neo4jPersistentProperty> path, Iterator<Object> actualParameters) {
383383

384-
Neo4jPersistentProperty leafProperty = path.getRequiredLeafProperty();
384+
Neo4jPersistentProperty leafProperty = path.getLeafProperty();
385385
Parameter p1 = nextRequiredParameter(actualParameters, leafProperty);
386386
Optional<Parameter> p2 = nextOptionalParameter(actualParameters, leafProperty);
387387

@@ -418,7 +418,7 @@ private Condition createNearCondition(PersistentPropertyPath<Neo4jPersistentProp
418418

419419
private Condition createWithinCondition(PersistentPropertyPath<Neo4jPersistentProperty> path, Iterator<Object> actualParameters) {
420420

421-
Neo4jPersistentProperty leafProperty = path.getRequiredLeafProperty();
421+
Neo4jPersistentProperty leafProperty = path.getLeafProperty();
422422
Parameter area = nextRequiredParameter(actualParameters, leafProperty);
423423
if (area.hasValueOfType(Circle.class)) {
424424
// We don't know the CRS of the point, so we assume the same as the reference toCypherProperty
@@ -477,7 +477,7 @@ private Property toCypherProperty(Neo4jPersistentProperty persistentProperty) {
477477

478478
private Expression toCypherProperty(PersistentPropertyPath<Neo4jPersistentProperty> path, boolean addToLower) {
479479

480-
Neo4jPersistentProperty leafProperty = path.getRequiredLeafProperty();
480+
Neo4jPersistentProperty leafProperty = path.getLeafProperty();
481481
Neo4jPersistentEntity<?> owner = (Neo4jPersistentEntity<?>) leafProperty.getOwner();
482482
Expression expression;
483483

src/main/java/org/springframework/data/neo4j/repository/query/PartValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private void validateNotACompositeProperty(Part part) {
9191

9292
PersistentPropertyPath<Neo4jPersistentProperty> path = mappingContext
9393
.getPersistentPropertyPath(part.getProperty());
94-
Neo4jPersistentProperty property = path.getRequiredLeafProperty();
94+
Neo4jPersistentProperty property = path.getLeafProperty();
9595
Assert.isTrue(!property.isComposite(), "Can not derive query for '%s': Derived queries are not supported for composite properties");
9696
}
9797

0 commit comments

Comments
 (0)