Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-18-2023 06:52 AM
Solved! Go to Solution.
01-19-2023 08:15 AM
You are using provided ids here. If you update the entities, it will always be considered as a new entity, because SDN cannot be sure if it already exists in the database in contrast to entities defined with _GeneratedValue_ at the id property.
You could also see the warning:
WARN 57763 --- [ main] o.s.d.n.c.m.DefaultNeo4jIsNewStrategy : Instances of class com.ilvo.neo4jdemo.nodes.Person with an assigned id will always be treated as new without version property
To solve this, the Person needs to get an additional field:
@Version
Long id;
01-19-2023 08:15 AM
You are using provided ids here. If you update the entities, it will always be considered as a new entity, because SDN cannot be sure if it already exists in the database in contrast to entities defined with _GeneratedValue_ at the id property.
You could also see the warning:
WARN 57763 --- [ main] o.s.d.n.c.m.DefaultNeo4jIsNewStrategy : Instances of class com.ilvo.neo4jdemo.nodes.Person with an assigned id will always be treated as new without version property
To solve this, the Person needs to get an additional field:
@Version
Long id;
01-19-2023 07:42 PM
Thank you very much.
I have another question,although having consulted the official reference.
how to fix the warning:
WARN 117602 --- [ main] o.s.d.n.c.mapping.Neo4jPersistentEntity : The entity com.ilvo.neo4jdemo.relationships.ActedIn is using a Long value for storing internally generated Neo4j ids. The Neo4j internal Long Ids are deprecated, please consider using an external ID generator.
Must I set another id(or other name, such as myId) to be the external ID which is a property,not a generated identity or elementId in neo4j database ?
01-19-2023 11:39 PM
Nothing you have to worry about.In general we advise to not use internal ids on entities. As I can see this is related to relationships in your case. Basically nothing you or we could do right now.
A little bit of background: Neo4j shifted with version 5 to something parallel to the legacy ids called elementId. We wanted to prepare SDN 7+ for this because ids _might_ not work in future major versions of Neo4j. That's why you see this warning.
01-20-2023 09:34 PM
I have a quick look at the source code of neo4j-java-driver and SDN 7.0 then find that SDN 7.0 doesn't support elementId yet. So when SND supports elementId ?
01-20-2023 07:52 AM
So,does SDN 7.0 has a map to elementId now ?
01-23-2023 12:07 AM
No, SDN still sticks with the internal ids (id(node/relationship)) right now and this still works as before.
01-23-2023 03:11 AM
I see, thank you ! ! !
All the sessions of the conference are now available online