Blaise:
Thanks for the reply. I have not come across any issues yet as I have
just started development. I am developing a RESTful web service that
will receive XML that will need to be mapped to JPA entities that will
be persisted. My initial thought was to create an XSD to define the web
service traffic, and run JAXB over this to create Java classes. I would
then define the entities to be persisted and manually write the code to
convert the XML to the entities. This just didnt feel right so I
started to see if there was a better way. It seems that the JAXB
annotations might be what I am looking for. From what I have seen thus
far, I will be able to both marshal and unmarshal the XML into my
entities. The only feature I would still like to have is the XSD. It
does not look like I can generate an XSD from JAXB annotated classes.
So, if I want the XSD it looks like I need to maintain multiple models.
Any other ideas?
Thanks
Adam
Blaise Doughan wrote:
Hi Adam,
My apologies for not getting back to the thread. If you let me know the
issues you are encountering I will help you out.
You should be able to do this in one model. Below is a link to an
example I am working on to do just what you are describing with the
EclipseLink 2.0 APIs:
* http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA
It is still a work in progress, some other things you will find useful:
* /*Bidirectional Relationship Support*/
Today we will be checking in an XMLInvereseReferenceMapping, this
mapping will allow you map back pointers.
* /*Composite Key Support*/
EclipseLink 2.0 now supports composite keys on all the key based
mappings. I still need to update the example with this.
-Blaise
Adam Stroud wrote:
All:
I am developing an application that uses Eclipselink both JAXB (Moxy)
and JPA. My question is what is the best way to go from my current
data model to entities and XML without maintaining three different
models. I saw an earlier post to the mailing list here ->
http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg03473.html,
but it does not look like the examples referenced in the reply were
posted to the list. Any input/guidance would be appreciated.
Thanks
Adam
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users