Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] MOXy & JPA

Hello Roger,

My recommendation to users is to start with a well designed model and use EclipseLink to map this model to both XML and your database. This will ultimately make your application development easier.

You can also take the model generated by JAXB and annotate it JPA annotations. Since JAXB will generate a class per level of nesting you will probably end up with a larger than desired domain model.

Maintaining seperate jaxb and jpa models and the logic to convert between is a brute force approach and ultimately the hardest to maintain. You end up with multiple models and custom conversion logic. A small change in either the db or schema requires changes to both the generated models (possibly regenerating) and custom conversion logic.

I am currently out of the office. I can send you some examples when I'm back on Monday.

-Blaise


On 2009-09-23, at 9:32 AM, Roger Varley <roger.varley@xxxxxxxxxxxxxx> wrote:

Hi

I've just started experimenting with MOXy and I've now managed to get
my java classes generated from an .xsd file. It's been a bit hit &
miss and I was wondering if there were any good tutorials on setting
up a MOXy project within Eclipse.

Now that I've got my @Xml annotated Java classes, can I now add JPA
annotations to them as well? Assuming that the answer is yes, is it
actually a good idea or would I be better to maintain a seperate set
of JPA .java files and use one of the Bean libraries to transfer data
between them?

Regards
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top