I think it ought to be possible to use Jaxb annotations on specific AO interface getters in order to serialise AO enties as XML in a REST response. But Im having some issues with generation:
Entity xxxxx has no primary key field
at net.java.ao.Common.getPrimaryKeyClassType(Common.java:291)
at net.java.ao.Common.getPrimaryKeyType(Common.java:283)
Failing this I guess Id have to populate specific entities for JAXB serialization but having two model structures seems a pain.
Community moderators have prevented the ability to post new answers.
You dont, you have to propogate your fields into the AO entity via your AOService, which can be constructor injected into your rest service?
I've found this documentation explaining how to annotate interfaces to use with JAXB: https://jaxb.java.net/guide/Mapping_interfaces.html#Use__XmlJavaTypeAdapter
Anyway, what can I do with an active objects' entity on my rest API? How to persist it if it does not have any entity manager injected and are out of persistence context? :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
Any movement with this issue? I'm facing same problem... :/ For now, I've separated my entity from "beans" to be serialized though REST API, what is not even close to a nice solution...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cheers Andy. I had the same idea, but didn't quite get the hierarchy straight in my mind, although it seems simple enough. What I tried didn't work anyway. When I get back to this I will give it another go.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, yea, I have the same issue for REST and AO data also.
Have you tried splitting the accessors into a MOdel interface not extending Entity, with accessor annotations, then, have your ActiveObject interface use multiple inheritence for both Entity and the Model interface? Ive done this in a limited way for my purposes, not gone the whole way. I wonder what happens if you push a cast reference to the Model into JAXB? Let me know :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andy - let me know if you got anywhere with this - I am having the same/similar issue: https://answers.atlassian.com/questions/189298/simple-crud-rest-api-for-active-objects-tables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.