Dear Bruce,

Thanks for the reply.

Do you mean that I can enclose the castor javadoc tag  in the documentation in XSD, then use the Castor Source generator to generate my Java Objects based on the XSD, the tags will appear in the generated java source code? And then by using XDoclet, I can generate the DDL I wanted?

What a great news to me, please add this 'million dollar' information to the Castor documetation on the web site asap so that more people will benefit from it.

 

Thanks.

 

Cheers,

Ng Keng Yap

 

 



 




NG KENG YAP
From: Bruce Snyder <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [castor-user] DLL Generation from OR Mapping in Castor possible without XDoclet?
Date: Wed, 6 Oct 2004 12:19:12 -0600 (MDT)
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


MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to