Discussion:
[castor-dev] JDO extension for Castor XML code generator - Preview
Werner Guttmann
2009-04-02 07:10:57 UTC
Permalink
Hi,

I am very pleased to announce the immediate availability of the

JDO extensions for the Castor XML code generator

in form of a *technology preview* as part of the first snapshot release
of Castor 1.3.1, which can be found at and downloaded from the snapshot
repository of the Codehaus at

http://snapshots.repository.codehaus.org/org/codehaus/castor

** Motivation **

With Castor 1.3 and previous releases it it has always been possible to
generate Java classes from an XML schema and use these classes for XML
data binding without having to write a mapping file.

This is possible because the Castor XML code generator generates - in
addition to the domain classes - a set of XML descriptor classes as
well, with one descriptor class generated per associated domain class.
It's this XML descriptor class that holds all the information required
to map Java classes and/or field members to XML artefacts, as set out in
the original XML schema definitions. This includes ....

- artefact names
- XML name space URIs
- XML name space prefix
- validation code

In addition, it was already possible to use the generated set of domain
classes in Castor JDO for object-/relational mapping purpose by
supplying a (manually written) JDO-specific mapping file. Whilst
technically not very difficult, this was still an error-prone task,
especially in a context where tens or hundreds of classes were generated
from a set of XML schemas.

** JDO extensions and XML schema annotations **

The JDO extensions for the Castor XML code generator extend the code
generator in such a way that - based on Castor JDO-specific annotations
being added to your XML schema - a second set of descriptor classes is
generated: the JDO descriptor classes. These new descriptor classes
define the mapping between Java (domain) objects and database
tables/columns, and as such remove the requirement of having to write a
JDO-specific mapping file. Please find an extended introduction to the
general principles at

http://www.castor.org/reference/html/jdo.extensions.html

where you'll find information about

- The XML schema artefacts available to annotate an existing XML schema
- Small examples to highlight the usage of these artefacts.
- A (limited) set of current product limitations.

Regards
Werner Guttmann

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...