This repository has been archived by the owner on May 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DATAGRAPH-1350 - Incoming relationships are not treated correctly whe…
…n using custom queries. (Backport) This change checks the direction of the relationship definition and based on that selects the corresponding target node id. It also uses the property accessor to retrieve the changed instance. Furthermore the opportunity is used for some polishing in the pom.
- Loading branch information
1 parent
c319fe3
commit 4f58375
Showing
5 changed files
with
181 additions
and
2 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
61 changes: 61 additions & 0 deletions
61
...ta-neo4j-rx/src/test/java/org/neo4j/springframework/data/integration/shared/AltHobby.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,61 @@ | ||
/* | ||
* Copyright (c) 2019-2020 "Neo4j," | ||
* Neo4j Sweden AB [https://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 | ||
* | ||
* https://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.springframework.data.integration.shared; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.neo4j.springframework.data.core.schema.GeneratedValue; | ||
import org.neo4j.springframework.data.core.schema.Id; | ||
import org.neo4j.springframework.data.core.schema.Node; | ||
import org.neo4j.springframework.data.core.schema.Relationship; | ||
import org.neo4j.springframework.data.core.schema.Relationship.Direction; | ||
|
||
/** | ||
* @@author Michael J. Simons | ||
*/ | ||
@Node | ||
public class AltHobby { | ||
@Id @GeneratedValue private Long id; | ||
|
||
private String name; | ||
|
||
@Relationship(type = "LIKES", direction = Direction.INCOMING) | ||
private Map<AltPerson, AltLikedByPersonRelationship> likedBy = new HashMap<>(); | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Map<AltPerson, AltLikedByPersonRelationship> getLikedBy() { | ||
return likedBy; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
.../java/org/neo4j/springframework/data/integration/shared/AltLikedByPersonRelationship.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,38 @@ | ||
/* | ||
* Copyright (c) 2019-2020 "Neo4j," | ||
* Neo4j Sweden AB [https://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 | ||
* | ||
* https://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.springframework.data.integration.shared; | ||
|
||
import org.neo4j.springframework.data.core.schema.RelationshipProperties; | ||
|
||
/** | ||
* @@author Michael J. Simons | ||
*/ | ||
@RelationshipProperties | ||
public class AltLikedByPersonRelationship { | ||
|
||
private Integer rating; | ||
|
||
public Integer getRating() { | ||
return rating; | ||
} | ||
|
||
public void setRating(Integer rating) { | ||
this.rating = rating; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...a-neo4j-rx/src/test/java/org/neo4j/springframework/data/integration/shared/AltPerson.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,50 @@ | ||
/* | ||
* Copyright (c) 2019-2020 "Neo4j," | ||
* Neo4j Sweden AB [https://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 | ||
* | ||
* https://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.springframework.data.integration.shared; | ||
|
||
import org.neo4j.springframework.data.core.schema.GeneratedValue; | ||
import org.neo4j.springframework.data.core.schema.Id; | ||
import org.neo4j.springframework.data.core.schema.Node; | ||
|
||
/** | ||
* @@author Michael J. Simons | ||
*/ | ||
@Node | ||
public class AltPerson { | ||
|
||
@Id @GeneratedValue private Long id; | ||
|
||
private final String name; | ||
|
||
public AltPerson(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |