I am using spring data neo4j version 4.1.2 with bolt driver 2.0.6. I am facing issue of breaking relationship between entities automatically.
I have an domain named organization and organization belongs to many entities but i am mentioning few.
Organization schema
public class Organization {
private String formalName;
private String shortName;
@Relationship(type = COUNTRY)
private Country country;
@Relationship(type = HAS_GROUP)
private List<Group> groupList = new ArrayList<>();
}
And country schema is
public class Country {
@Relationship(type = HAS_HOLIDAY)
private List< CountryHolidayCalender> countryHolidayCalenderList;
}
When i am updating organization it breaks all relationship of country like breaks country-holiday relationship etc
Organization update code
Organization unit = organizationGraphRepository.findOne(unitId);
unit.setFormalName(organizationGeneral.getFormalName());
unit.setShortName(organizationGeneral.getShortName());
organizationGraphRepository.save(unit);
I am unable to find, what i am doing wrong. Please help me, we can't afford this kind of bug at this time.
Thanks