eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Other
231 stars 72 forks source link

Pass the Document to the custom AttributConverter when converting att… #268

Closed redmitry closed 1 year ago

redmitry commented 2 years ago

…ribute is not primitive type.

Currently the enclosed value is passed to the converter, what is good for the primitive types, but in a case of the entity a list of properties is passed (List) which is counterintuitive. The Value would also be an option, but the Document is more similar to the TypeReferenceReader.

genie-jnosql commented 2 years ago

Can one of the admins verify this patch?

otaviojava commented 2 years ago

@redmitry thank you for the contribuition. What do you think if we include a test scenario here?

redmitry commented 2 years ago

Hi Otavio,

I attach some example of what I supposed to do. Unfortunately I found no solution to use @Convert for the entities. The deserialization is a pain without an access to the DocumentEntityConverter which is the other module. Another issue (for the polymorphism) is that I can't skip serialization. I would suppose be able to skip it in some way... Unfortunately, the only mechanism left is via TypeReferenceReader ... (is any TypeReferenceWriter?).

I suggest dismiss this patch as it doesn't put any value.

Kind regards,

Dmitry

nosql-entity-converter-test.zip

otaviojava commented 1 year ago

Hey @redmitry I'll merge it on a PR.