Stefan,

Have you ever had a look at the MappingTool
(src/main/org/exolab/castor/tools/MappingTool) that uses standard
introspection to generate a mapping file from a given set of classes ?
As far as I know, it creates a Castor XML-specific mapping file only,
but I think it should not be too hard to add code that generated the
<sql> elements for the classes given.

In other words, why re-invent the wheel when the MappingTool already
offers funtionality that you require, but is not feature complete yet.

Regards
Werner

wg> -----Original Message-----
wg> From: Stefan Lober [mailto:[EMAIL PROTECTED] 
wg> Sent: Monday, November 14, 2005 8:25 PM
wg> To: dev@castor.codehaus.org
wg> Subject: [castor-dev] [JDO] Modifying SourceGenerator to 
wg> have source and O/R mapping generated at the same time
wg> 
wg> Hello,
wg> I am looking for a solution to automatize our project 
wg> development using Castor. As this has also been an issue in 
wg> recent threads, I am now posting my ideas and problems.
wg> My input is DTD file, which is converted to an XSD. I then 
wg> use the SourceGenerator to have the source files generated 
wg> from this XSD. The next step should be generating the O/R 
wg> mapping files for Castor. My idea is that this could be 
wg> done automatically from the information in the XSD. Is 
wg> there any use in trying to modify the SourceGenerator code 
wg> to do this?
wg> So far, I have been able add code for generating mappings 
wg> for classes that use only basic Java types as members. This 
wg> is done at the code location where the flags for 
wg> "-gen-mapping" and "-nodesc" are queried. I use the 
wg> MappingRoot object to get the necessary information.
wg> There are two main problems:
wg> -My generated classes don't have ids.
wg> -In the ClassMapping objects, I don't see any information 
wg> about the cardinality of a relation (1:1, 1:N or M:N).
wg> 
wg> The use of a toolkit like XDocLet would not work as there 
wg> is no information in the generated classes which can be 
wg> used as input for doclet-tools.
wg> 
wg> Any suggestions would be appreciated!
wg> Thanks,
wg> Stefan
wg> 
wg> 
wg>     
wg> 
wg>     
wg>             
wg> ___________________________________________________________
wg> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos 
wg> - Hier anmelden: http://mail.yahoo.de
wg> 
wg> -------------------------------------------------
wg> If you wish to unsubscribe from this list, please send an 
wg> empty message to the following address:
wg> 
wg> [EMAIL PROTECTED]
wg> -------------------------------------------------
wg> 
wg> 

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to