Spring Data Neo4j does not update node

I user spring-boot-starter-data-neo4j version 2.4.5

I think it has something to do with the following warning:
Instances of class de.fh.kiel.advancedjava.pojomodel.model.Pojo with an assigned id will always be treated as new without version property!
which always pops up if I try to save anything.

My node:

public class Pojo {

    private boolean emptyHull;

    private String completePath;
    private String className;
    private Package aPackage;

    @Relationship(type = "attributes")
    private Set<Attribute> attributes;

    @Relationship(type = "parent")
    private Pojo parentClass;

    @Relationship(type = "interfaces")
    private Set<String> interfaces;

If try to update the node like this:

var pojo = pojoRepository.findById(id);


it does not update the node.

My ids look like this: de.fh.kiel.advancedjava.pojomodel.exampleData.DefaultClass
They are names names but each name is unique.

I tried to add a version property like this:

    private Long version;

My Application did not work after that. I guess I need to add it differently or need to change my constructurs for that to work. But is the verison property even the problem?

Yes, that is right. Because the entity is seen as new, no relationship will be dropped.
But it should create new ones.

I assume that the problem is the missing version property on the Pojo nodes now. It has to be set before working with the data because otherwise there would be no chance for SDN to enable the versioning / optimistic locking.
Basically a MATCH (n:Pojo) SET n.version = 0 would be enough to get it running.