-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Proper conjunct (nested) filters on relationship queries.
Fixes #1218. Signed-off-by: Michael Simons <michael.simons@neo4j.com>
- Loading branch information
1 parent
ba08f84
commit c675e8b
Showing
5 changed files
with
217 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...-ogm-tests/neo4j-ogm-integration-tests/src/test/java/org/neo4j/ogm/domain/music/Node.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2002-2025 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.neo4j.ogm.domain.music; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import org.neo4j.ogm.annotation.Id; | ||
import org.neo4j.ogm.annotation.NodeEntity; | ||
import org.neo4j.ogm.annotation.Relationship; | ||
|
||
/** | ||
* GH-1218 | ||
*/ | ||
@NodeEntity | ||
public class Node { | ||
|
||
@Id | ||
String id; | ||
|
||
@Relationship(type = "relationship") | ||
public Set<RelBetweenNodes> relationships = new HashSet<>(); | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public Set<RelBetweenNodes> getRelationships() { | ||
return relationships; | ||
} | ||
|
||
public void setRelationships(Set<RelBetweenNodes> relationships) { | ||
this.relationships = relationships; | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...neo4j-ogm-integration-tests/src/test/java/org/neo4j/ogm/domain/music/RelBetweenNodes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2002-2025 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.neo4j.ogm.domain.music; | ||
|
||
import org.neo4j.ogm.annotation.EndNode; | ||
import org.neo4j.ogm.annotation.GeneratedValue; | ||
import org.neo4j.ogm.annotation.Id; | ||
import org.neo4j.ogm.annotation.NodeEntity; | ||
import org.neo4j.ogm.annotation.Relationship; | ||
import org.neo4j.ogm.annotation.RelationshipEntity; | ||
import org.neo4j.ogm.annotation.StartNode; | ||
import org.neo4j.ogm.domain.drink.Manufacturer; | ||
import org.neo4j.ogm.id.UuidStrategy; | ||
|
||
/** | ||
* GH-1218 | ||
*/ | ||
@RelationshipEntity(type = "relationship") | ||
public class RelBetweenNodes { | ||
|
||
@Id @GeneratedValue | ||
private Long id; | ||
|
||
@StartNode | ||
private Node start; | ||
|
||
@EndNode | ||
private Node end; | ||
|
||
public Node getEnd() { | ||
return end; | ||
} | ||
|
||
public void setEnd(Node end) { | ||
this.end = end; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Node getStart() { | ||
return start; | ||
} | ||
|
||
public void setStart(Node start) { | ||
this.start = start; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters