Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [nosql-dev] The right way to get DefaultDocumentEntityConverter instance.

Hey, how are you?

Indeed we have two ways.
It is because Jakarta NoSQL has two layers: communication and mapping.

In the communication layer, you have the option of using SPI to teach a custom type:
https://www.jnosql.org/spec/#_make_custom_writer_and_reader
Therefore, the communication will convert the type in the database layer.

In the mapping it follows the same idea around the JPA converter:

https://www.jnosql.org/spec/#_convert

Please, let me know if it helps.
If not, please, don't hesitate to ask questions and give feedback as much as possible.

Suppose it is not clear, excellent! We can improve our documentation as well.
Does it help you?

Thank you for your participation here.



On Thu, Apr 28, 2022 at 6:12 PM Dmitry Repchevsky via nosql-dev <nosql-dev@xxxxxxxxxxx> wrote:
Hello,

The @Convert(AttributeConverter.class) is a simple way to provide custom
serialization / deserialization mechanism similar to the JsonbAdapter.
Unfortunately, unlike JSON-B, Jakarta NoSQL has no custom Serializers
/Deserializers support. Deserializers in JSON-B are more useful for the
polymorphism, because they provide the context so I can deserialize the
object of choice easily once I decide on the type.

What is the correct way to to this from the custom converter class?
May I have an access to the DefaultDocumentEntityConverter?

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