jnosql icon indicating copy to clipboard operation
jnosql copied to clipboard

Pass the Document to the custom AttributConverter when converting att…

Open redmitry opened this issue 3 years ago • 3 comments

…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<Document>) which is counterintuitive. The Value would also be an option, but the Document is more similar to the TypeReferenceReader.

redmitry avatar May 05 '22 08:05 redmitry

Can one of the admins verify this patch?

genie-jnosql avatar May 05 '22 08:05 genie-jnosql

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

otaviojava avatar May 06 '22 06:05 otaviojava

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

redmitry avatar May 06 '22 16:05 redmitry

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

otaviojava avatar Jan 21 '23 16:01 otaviojava