Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Big Picture
Big Picture [message #499732] Mon, 23 November 2009 21:23 Go to next message
Mark Fenbers is currently offline Mark FenbersFriend
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
Seeking advice....

I am an experienced Eclipse IDE user, but a newbie to EclipseLink WorkBench.

I have a "big picture" type question. I have done a lot of reading on this topic over the past few days, but nothing ever really paints the big picture for me.

The bottom line is that I want to bind XML to Java objects in my code using JAXB. (The "mother ship" uses JAXB, so I want my code to conform.)

The XML schema should not change much over time, but the data in the XML will be different every hour. My understanding is that in using JAXB, if my XML files change format (say, a new element is added), my code doesn't have to change -- just some config file. Am I correct about this?

I've never messed with XML bindings before and am new to JAXB. I'm not sure how to go about this project. I have the XML files (including the associated *.xsd files). I downloaded and installed EclipseLink, created a test project, and attempted to import a schema definition file, but this seems to be broken. If I must proceed this way, I can write another post that asks about this brokenness, but for now, I may not even have to go down that road.

Do I need to use EclipseLink for to create a relationship between my Java code and the XML file? Is there a better/simpler alternative?

Advice sought... Thanks!

Mark
Re: Big Picture [message #500085 is a reply to message #499732] Tue, 24 November 2009 21:33 Go to previous message
Blaise Doughan is currently offline Blaise DoughanFriend
Messages: 163
Registered: July 2009
Senior Member

Hi Mark,

If you have an XML schema and you generate a Java model from that using JAXB 2.0 (or 2.1) then that object model will handle any XML document that is valid for that XML schema.

Now I believe you have a use case where small changes are made to your XML schema over time and you need to amend your object model to reflect this, is this correct?

If so there are a couple of approaches that you can take:

1. Regenerate your object model from XSD
This will replace your old object model with the newly generated one.

2. Add the new properties to your object model manually and add the corresponding JAXB annotations manually.

3. Add the new properties to your object model manually, and map them using EclipseLink extended mappings.

4. Refactor your object model to make them more future proof.

If you could provide more details on your use case, I can recommend an approach.

-Blaise
Previous Topic:spring IndexOutOfBoundsException
Next Topic:creating history records - potential clock issues
Goto Forum:
  


Current Time: Fri Nov 28 15:08:37 GMT 2014

Powered by FUDForum. Page generated in 0.04907 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software