On 2/13/06, David Blevins <[EMAIL PROTECTED]> wrote:
>
> On Feb 8, 2006, at 11:04 PM, David Blevins wrote:
> >>> Also, somewhat unrelated, what do you do for reading in
> >>> deployment descriptors?  OpenEJB used to use Castor XML, then we
> >>> switched to XMLBeans in Geronimo.
> >>>
> >>> I was thinking maybe JAXB2.  One of the first steps will be
> >>> reading in a persistence.xml so we can pull out the JPA
> >>> PersistenceProvider and create those PersistenceUnitInfo thingies.
> >
> > I'm really more interested in someone getting experience on JAXB2
> > than reusing the code to marshall a persistence.xml.  Specifically,
> > if it works well I'll want to roll it out instead of xmlbeans for
> > the other dozen and more deployment descriptors which have four
> > major versions each as well for our own config files.
>
> So I chatted with Jeff on irc and he dug into creating a plugin for
> jaxb that allows you to do code generation like we are doing with
> XMLBeans.   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.
>
> Not sure if there is also a (better?) way to marshal to and from a
> non-jaxb specific pojo tree like that in JAXB2.  In JAXB1 you had to
> inherit from a special object class.  Don't know what is doable in
> JAXB2.
>
> I'm Cc'ing Bruce and Keith of Castor as they are the local experts I
> know of.
>
> Hey Keith, many moons ago I sent a note to the Castor list asking if
> it would be possible for you to generate a pojo tree *and* a mapping
> file -- rather than a pojo tree and descriptor classes for marshalling.
>
> If we could get that feature we'd be in great shape!!!

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.

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.

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