On Feb 13, 2006, at 9:24 PM, Bruce Snyder wrote:

On 2/13/06, David Blevins <[EMAIL PROTECTED]> wrote:
Getting away from repeated code generation on standard
schemas would be a good thing.

We need something more akin to a standard tree for ejb to hold
deployment descriptor info for each version of ejb 1.1, 2.0, 2.1, and
3.0 deployment descriptors and some way to marshall it.  You can do
this with castor with some work, but you're stuck creating the
mapping files for each deployment descriptor version.  Good that it's
solvable, but no fun either.


I don't think that this will help this situation, necessarily, but
I'll throw it out there anyway. It is also possible to place
annotations in the XSD and let it be carried from there into the Java
classes and then be used to generate the mapping descriptor. So that
process is:

annotations in the XSD --> Java source --> mapping descriptor

I've done this with XDoclet annotations but any annotations will work
because it's not the annotation that matters, it's what is generated
from the annotations that really matters.

You have any examples of annotated xsd that you've used this for?

I would agree that the best case scenario is to have Castor generate
the mapping descriptor. The trouble with this is that generated
mapping descriptor might need some hand tweaking. This is where the
influence of annotations starts to look good because it removes any
need for any manual work.

It's seems Keith did add a mapping file generator for me when I hit him up for the feature a little more than a solar cycle ago....

The warning he gave is that it's not perfect. Fine with me. You get me thinking though.... If there is any additional information we need to specify to the xsd-based mapping file generator, we could do it via xsd annotations also.

My brain gets me wondering how cool it would be to annotate elements with a "since 1.1" or "since 2.0" and get all our mapping files generated in one go; ejb 1.1, ejb 2.0, ejb 2.1, ejb 3.0.

There I go dreaming again....

Anyone have time to try Keith's pojo w/ mapping file generation tool on the ejb 3.0 schema or maybe something smaller like the persistence.xml?


-David

Reply via email to