This one time, at band camp, Jeremy Nicholson said:
JN>import org.exolab.castor.tools.MappingTool;
JN>import java.io.*;
JN>/**
JN>* generate a Castor mapping file ready for editing
JN>*/
JN>public class CastorMapper {
JN>/**
JN>* generate a Castor mapping file ready for editing
JN>*/
JN>public CastorMapper()
JN>{
JN>try
JN>{
JN>MappingTool tool = new MappingTool();
JN>tool.addClass(DragQuestion.class);
JN>tool.addClass(Group.class);
JN>.......
JN>tool.addClass(User.class);
JN>OutputStream file = new FileOutputStream("gen_mapping.xml");
JN>Writer writer = new OutputStreamWriter(file);
JN>
JN>tool.write(writer);
JN>}
JN>catch (Exception ex)
JN>{
JN>ex.printStackTrace();
JN>}
JN>}
JN>public static void main(String[] args)
JN>{
JN>new CastorMapper();
JN>}
JN>}
Jeremy,
That's a great programmatic example. I've also got a shell script
for running the mapping tool from the command line on a single base
class. I guess I should check this in.
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