You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see my minimal example project demo.zip and run the test. On an node entity, I changed a relation and it was not written to DB as expected when calling save method.
Current Behavior
Excerpt from my node entity:
@NodeEntity
public class MyNode {
...
@Relationship(type = "REL_ONE", direction = INCOMING)
private MyNode refOne;
@Relationship(type = "REL_TWO", direction = UNDIRECTED)
private List<MyNode> refTwo = new ArrayList<>();
...
public MyNode copy() {...}
...
}
If I change the "refTwo" relation direction to OUTGOING, then it is working but I really need to have undirected relation there.
Also if I do not use a copy of the node entity, then it is working, too (with UNDIRECTED relation). Although the copy is not required in the simple example, in my real application the copy is required because I change the node entity, do some queries that yield the node entity and save finally. If I wouldn't copy the node entity then the queries would overwrite the changed data.
Possible Solution
Steps to Reproduce (for bugs)
Call the :test task of the supplied demo project in debug mode (e.g. use IntelliJ) such that "assert" will trigger. Test will fail in line 62 of NodeService class because the relation changed before was not written to neo4j.
Context
Your Environment
OGM Version used: 3.1.11
Java Version used: 11
Neo4J Version used: 3.5
Operating System and Version: Win/Ubuntu
The text was updated successfully, but these errors were encountered:
This change tries to store visited nodes under their native graph id in the compile context if possible. Thus, they are recognized even when a user uses a different instance of the same entity for persisting state.
This fixes#640.
…#642)
This change tries to store visited nodes under their native graph id in the compile context if possible. Thus, they are recognized even when a user uses a different instance of the same entity for persisting state.
This fixes#640.
Expected Behavior
Please see my minimal example project demo.zip and run the test. On an node entity, I changed a relation and it was not written to DB as expected when calling save method.
Current Behavior
Excerpt from my node entity:
If I change the "refTwo" relation direction to OUTGOING, then it is working but I really need to have undirected relation there.
Also if I do not use a copy of the node entity, then it is working, too (with UNDIRECTED relation). Although the copy is not required in the simple example, in my real application the copy is required because I change the node entity, do some queries that yield the node entity and save finally. If I wouldn't copy the node entity then the queries would overwrite the changed data.
Possible Solution
Steps to Reproduce (for bugs)
Call the :test task of the supplied demo project in debug mode (e.g. use IntelliJ) such that "assert" will trigger. Test will fail in line 62 of NodeService class because the relation changed before was not written to neo4j.
Context
Your Environment
The text was updated successfully, but these errors were encountered: