|Re: GF4+MOXy+@XmlNamedObjectGraph to generate JSON [message #1236458 is a reply to message #1235137]
||Mon, 27 January 2014 09:03
| Neikius Mising name
Registered: April 2011
Thanks, asking it on the mailing list probably won't be necessary, the slides gave me what I needed, though I had some hard time even when I knew exactly what I was trying to do, also upgrading GF was a nightmare... |
I am using @EntityFiltering annotations now as per Jersey 2.5 manual chapter 17, it works but you have to be really careful when using them. Without your slides I would have never figured out this feature existed.
Thanks again and I might drop by the mailing lists if I have more trouble regarding this.
Not really important but vaguely related problem:
Right now I have a strange problem regarding @XmlDiscriminator, moxy will force the default discriminator on me even though I don't ever unmarshall so I don't need it! Any way to disable that feature? I think I get the "type":"classname" discriminator property in JSON because I have a superclass, but if I remove the empty superclass I use on every entity right now, I get NPE again in createObjectGraph->createSubgraphs same as I got when I had cyclical bidirectional relations.
This seems a MOXy "bug" - when creating an object graph it will always create the entire object graph, even when using entity filtering. This seems a) excessive b) problematic c) undesirable. @XmlTransient is ignored in this case. @XmlInverseReference seems to work but is a bit redundant when you are using @EntityFiltering annotations. Hence I won't be able to annotate my JPA entity model from db, but will be forced to copy field-by-field to a second set of @Xml annotated POJO's. I will probably just ditch everything from 2 days ago to today since it seems this brings more and more problems with zero benefits as I delve deeper.
[Updated on: Mon, 27 January 2014 10:03]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.04343 seconds