Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [nosql-dev] parasite properties (issue 259)

Hey, Dmitry thank you for all the feedback.

I'm working on it, basically, I'll create an extension of MongoDB to support this specific behavior on the id.
About the null, it is a bug I'll create an issue on it.

Thank you for that great feedback!


On Wed, Mar 2, 2022 at 4:13 PM Dmitry Repchevsky via nosql-dev <nosql-dev@xxxxxxxxxxx> wrote:
Hello,

As I already described in the
https://github.com/eclipse/jnosql/issues/259 , there is a strange jnosql
behavior while deseriaizing from mongodb with an empty (absent) object
property.

CitizenRepository repository = service.getCitizenRepository();

-----------------------------------------------------------------------------------

Citizen citizen = new Citizen();
citizen.setId("1234");
citizen.setName("Dmitry");

Citizen s = repository.save(citizen);

City city = s.getCity(); // ???
String name = city.getName(); // ???????
System.out.println("citizen.city.id = " + name);
-----------------------------------------------------------------------------------

There are two problems here.
1. Non existent "City" entity is created, while should be null
2. AbstractDocumentEntityConverter not only creates the "City" entity,
but passes "Citizen" properties to initialize it, so we have the "City"
with "id" and "name" taken from the "Citizen".

I attach my test project to see it.

Kind regards,

Dmitry


_______________________________________________
nosql-dev mailing list
nosql-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/nosql-dev


--
Otávio Santana

Back to the top