On 2/13/06, David Blevins <[EMAIL PROTECTED]> wrote:
>
> 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?

Sure, here's one here:

http://www.jroller.com/page/CastorLive?entry=round_trip_code_generation_with

it's brief but it proves the point. I know that this is far more an
application development approach, I just figured I'd make it known
that it does work.

> > 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.

Right, that's the real hidden gem with annotations, the possibilities
are endless because it's the post processing that determines how
they're used. Many different annotations can live together and not
really care about one another and even be conflicting. As long as the
processor can handle it all is well.

> 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?

Trying it now ;-).

Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo (http://geronimo.apache.org/)

Castor (http://castor.org/)

Reply via email to