This one time, at band camp, Ng Keng Yap said:

NKY>Thanks for the reply.
NKY>
NKY>As far as I know from the documentation, Castor only supports XDoclet for OR
NKY>Mapping to DDL generation.  Xdoclet requires generated object source to be
NKY>altered on its javadoc header tags, which is not so ideal i should say.
NKY>Regeneration of the objects from XSD will override the remove the javadoc
NKY>tags added. Any other way of generating DDL?

I ran into this exact problem while authoring the Castor Live book
and I've found a partial way around it. XML Schema supports
documentation and the Source Generator will will carry this
documentation through to the generated code. Below is a small example
of an XSD containing XDoclet tags:

<element name="book" maxOccurs="unbounded">
    <annotation>
        <documentation>
        @castor.class name="com.sourcebeat.castorlive.sample.model.Book"
        id="book-id" table="book"
        </documentation>
    </annotation>
    <complexType>
        <sequence>
            <element name="title" type="string">
                <annotation>
                    <documentation>
                    @castor.field type="string"
                    @castor.field-sql name="title" type="varchar"
                    @castor.field-xml name="title" node="attribute"
                    </documentation>
                </annotation>
            </element>
        ...
            <element name="author" type="author">
                <annotation>
                    <documentation>
                    @castor.field type="com.sourcebeat.castorlive.sample.model.Author"
                    @castor.field-sql name="author"
                    @castor.field-xml name="author" node="element"
                    </documentation>
                </annotation>
            </element>

I haven't gotten this completely working yet. I still need to finish
this because I want to include this in the Castor Live book.

As a side note, just this morning I hit a point where I need to
extend the Castor support in XDoclet so that it covers everything
in the mapping descriptor. The current version of XDoclet only
supports Castor JDO, it doesn't support Castor XML.

Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to