Skip to content

Commit adabebd

Browse files
committed
Fix duplication of match pattern.
Signed-off-by: Gerrit Meier <[email protected]>
1 parent 9fb51a4 commit adabebd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ public Statement toStatement() {
170170

171171
StatementBuilder.OngoingReadingWithoutWhere match = Cypher.match(this.matchOn.get(0));
172172

173-
for (PatternElement patternElement : this.matchOn) {
174-
match = match.match(patternElement);
173+
if (this.matchOn.size() > 1) {
174+
for (PatternElement patternElement : this.matchOn.subList(1, this.matchOn.size())) {
175+
match = match.match(patternElement);
176+
}
175177
}
176178

177179
StatementBuilder.OngoingReadingWithWhere matchWithWhere = match.where(this.condition);

0 commit comments

Comments
 (0)