jsonschema2pojo + JPA annotations

220 views
Skip to first unread message

maverick

unread,
Mar 10, 2014, 10:59:59 AM3/10/14
to jsonschema...@googlegroups.com
Hi,

Is it possible to generate JPA annotations when the model objects are created from json using jsonschema2pojo maven plugin? 

Thanks

Joe Littlejohn

unread,
Mar 11, 2014, 11:17:24 AM3/11/14
to jsonschema...@googlegroups.com
Hi Aseem,

The library doesn't support this right now however you could possibly implement your own custom annotator to do this. You would need to implement org.jsonschema2pojo.Annotator and activate your own annotator using the customAnnotator config option.

Another alternative would be to use jsonschema2pojo as a one-off, up-front task to generate the beans and then hand edit them from then on (to add annotations or new properties in future).

Hope this helps,

Joe






--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aseem Belsare

unread,
Mar 11, 2014, 11:24:12 AM3/11/14
to jsonschema...@googlegroups.com
Thanks. I started on that route of writing a custom annotator for the annotations that I needed, I'll also look into the second option that you've described, but I think the requirement is to generate models from JSON with annotations on it.

Thanks for the reply though, I really appreciate.

Aseem


--
You received this message because you are subscribed to a topic in the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsonschema2pojo-users/_l5OGenkMO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsonschema2pojo-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages