Closed sanjuthomas closed 4 years ago
Is there a way I can use the simple name of the class?
You definitely can. I would recommend you use JacksonDatabindHandle for that. That way you'll have full control over the serialization. PojoRepository, on the other hand, is more useful when you don't care about the structure of the persisted content, and are looking at things from a pure POJO perspective.
Please let us know if you find that using JacksonDatabindHandle together with JSONDocumentManager is significantly more difficult than using PojoRepository. For some related explanation, see this blog post about io shortcuts, the javadoc section "Registering New IO Representations for Shortcut Methods", and JacksonDatabindTest.beforeTest and JacksonDatabindTest.JsonCityWriter .
Also, how do I control the URI of the document when I use PojoRepository?
Again, that's more in your control when you use JSONDocumentManager. With PojoRepository you only control which property to annotate with @Id and the values in those properties. If you need more control over the uri, please try JSONDocumentManager.
Thanks @sammefford , I will check and confirm.
@sanjuthomas, I'm just checking in--could you use any more help on this issue?
@sammefford thanks for checking. As you said, there are other ways to achieve what I wanted.
This is a question -
I was testing the PojoRepository.write and noticed that the documents are created with the canonical name of the class. Is there a way I can use the simple name of the class?
Say for example, instead of having this
Can I have this?
Also, how do I control the URI of the document when I use PojoRepository?