-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@RelationshipEntity not hydrated [DATAGRAPH-961] #1525
Comments
G'Kar commented Hi there, I might have encountered a related issue. I'm able to retrieve a RelationshipEntity with the following query: @Query("match (p:PostNode) - [pr:POST_RECEPTION] -> (rn:ReceivedPostsNode) where p.postID={0} and pr.postRetrieved = FALSE and rn.userid = {1} return p, rn, pr")
public PostReceptionRel findBypostId(String postId, String userid); My relationship entity is as follows: @RelationshipEntity(type = "POST_RECEPTION")
public class PostReceptionRel
{
@GraphId Long id;
private boolean postRetrieved = false;
private boolean postRead = false;
@StartNode private PostNode postNode = null;
@EndNode private ReceivedPostsNode receivedPostsNode = null;
} However if I update the relationship a phantom node is created which screws up a lot of subsequent procedures. Please see attached screenshot. I'm using: |
Agostino Semeria commented According to this commit neo4j/neo4j-ogm@7712030 Which is the right behaviour? |
Nicolas Mervaillie commented Can you detail your use case pls ? |
Agostino Semeria commented Before the 4.2.0 this code worked well @Query("MATCH (a:User) - [r:FRIEND_WITH] -> (b:Person) RETURN r, a, b")
FriendshipEntity loadFriendship(...);
@RelationshipEntity(type="FRIEND_WITH")
public class FriendshipEntity {
@GraphId private Long relationshipId;
@StartNode private User user;
@EndNode private Person person;
}
@NodeEntity(label = "User")
public class User {
@Property(name = "firstName")
private String mFirstName;
@Property(name = "lastName")
private String mLastName;
public String getFirstName() {
return mFirstName;
}
public void setFirstName(String pFirstName) {
mFirstName = pFirstName;
}
public String getLastName() {
return mLastName;
}
public void setLastName(String pLastName) {
mLastName = pLastName;
}
} @NodeEntity(label = "Person")
public class Person {
@Property(name = "firstName")
private String mFirstName;
@Property(name = "lastName")
private String mLastName;
public String getFirstName() {
return mFirstName;
}
public void setFirstName(String pFirstName) {
mFirstName = pFirstName;
}
public String getLastName() {
return mLastName;
}
public void setLastName(String pLastName) {
mLastName = pLastName;
}
} After the 4.2.0 to make this code works I need to add this properties at least to User entity (source entity of the relationship) @Relationship(type = "FRIEND_WITH")
private FriendshipEntity mFriendship; |
Nicolas Mervaillie commented Sorry I've been unclear. I've seen that the behavior changed since 4.2. Is it a strong requirement for you ? |
Nicolas Mervaillie commented fixed by neo4j/neo4j-ogm#309 |
Agostino Semeria opened DATAGRAPH-961 and commented
The same code, executed with the new snapshot version of spring-data-neo4j (4.2.0.BUILD-20170123.104601-200) doesn't return the existent relationship
The same code executed with the previous version (4.2.0.BUILD-20161223.121144-184) works well
Affects: 4.2 RC1 (Ingalls), 4.2 GA (Ingalls)
Reference URL: http://stackoverflow.com/questions/41824592/relationshipentity-not-hydrated
Attachments:
Backported to: 4.2.1 (Ingalls SR1)
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: