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
I am not sure this is a bug or if I'm not understanding/using projections correctly, so I do apologize if this is the expected behavior, but the docs are not clear if it is or not.
I have a CityModel which has several relationships to PersonModel objects. The city has a MAYOR, CITIZENS, and EMPLOYEE relations to people. I create a CityModel and PersonModel and persist them to the database. I then try to load the city Model as a projection (CityModelDTO) and connect it to a PersonModel by creating a PersonModelDTO instance and setting the id to match the previously persisted PersonModel. I then save CityModelDTO via Neo4jTemplate. If I then reload it as a CityModel none of the relationships I tried to save are present. Additionally the @Property("exotic.property") property is not updated as expected.
It is not in my reproduction, but I also tried to have a PersonModelRepository that could load the PersonModelDTO in case there was any secret sauce in the loaded DTO to help make the connection but got the same result.
What I expect to happen:
Persisting the DTO should create relationships to the existing nodes or create them with the projection properties if they do not exist. If this is not the intended behavior, I would expect to see warnings / errors in the console that the relationships will not be persisted.
What does happen:
No warnings or errors in the console but the relationships / property change are not persisted.
Thank you for your work on SDN :)
The text was updated successfully, but these errors were encountered:
Hi, same here: Thanks for the excellent report, a fix is on its way from 6.1 on upwards.
michael-simons
changed the title
Cannot Persist Relationships or Properties with periods (.) In DTO Objects
Relationships are not persisted when saving DTO objects as domain objects.
Feb 7, 2022
Hello-
I am not sure this is a bug or if I'm not understanding/using projections correctly, so I do apologize if this is the expected behavior, but the docs are not clear if it is or not.
I am using:
SDN 6.2.1
Java 11.0.14
Reproduction:
Reproduction can be found here: in this repository, specifically this test
I have a
CityModel
which has several relationships toPersonModel
objects. The city has aMAYOR
,CITIZENS
, andEMPLOYEE
relations to people. I create aCityModel
andPersonModel
and persist them to the database. I then try to load the city Model as a projection (CityModelDTO
) and connect it to aPersonModel
by creating aPersonModelDTO
instance and setting the id to match the previously persistedPersonModel
. I then saveCityModelDTO
viaNeo4jTemplate
. If I then reload it as aCityModel
none of the relationships I tried to save are present. Additionally the@Property("exotic.property")
property is not updated as expected.It is not in my reproduction, but I also tried to have a
PersonModelRepository
that could load thePersonModelDTO
in case there was any secret sauce in the loaded DTO to help make the connection but got the same result.What I expect to happen:
Persisting the DTO should create relationships to the existing nodes or create them with the projection properties if they do not exist. If this is not the intended behavior, I would expect to see warnings / errors in the console that the relationships will not be persisted.
What does happen:
No warnings or errors in the console but the relationships / property change are not persisted.
Thank you for your work on SDN :)
The text was updated successfully, but these errors were encountered: