Good question, Michelle. My first interpretation when reading that paragraph is that it would be your latter option, where XML can be 'mixed in' with annotations, overriding any that already exist on an individual basis. As a user, I would expect this. It is especially important when considering separating out ORM-specific metadata into XML. For example, I would want to be able to specify *what* is persistent in annotations, and *how*/*where* it is persisted in XML.

Speaking from my current experience with using 2.1 annotations in a large code base, we're putting everything, including ORM metadata in annotations. This is largely to keep things simple. It's much easier for the uninitiated to deal with all the metadata being in annotations in the classes they care about than having to know about, track down, and understand the package.jdo XML. However, I can see a day coming when we will need to deploy all or part of the code base against multiple, somewhat differing data models, and it would be nice to be able to override the hard-coded ORM annotations in XML. Hopefully that doesn't make for an implementation nightmare :-)

At any rate, thanks for bringing this up. It'll be nice to have the spec be particular on this topic, one way or the other.

- Chris Beams


On Aug 4, 2007, at 2:02 PM, Michelle Caisse wrote:

Hi Craig,

Chapter 19 says: "If xml metadata is defined for annotated classes, fields, or properties, xml metadata overrides the annotation." I think there needs to be further discussion about what level the override happens on. Are all of the annotations in the class automatically overriden if there is xml for the class, does the override happen only for annotations for which there is a corresponding xml element, ...?

-- Michelle

Craig L Russell wrote:

at http://db.apache.org/jdo/documentation.html

Check it out, and send comments...

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/ jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!



Reply via email to