Hi Ross, The source generator can generate more Castor-JDO friendly code by doing a few things.
1. Enable the extra collection methods by uncommenting the following line from castorbuilder.properties (or adding it to your local copy) # Set to true if you want the generated source code to contain # Extra methods for the collection fields, such as get/set using # the collection type in addition to the type-safe array. # Set this to true if you want your code to be more compatible # with Castor JDO. This is false by default. # #org.exolab.castor.builder.extraCollectionMethods=true 2. The next step is to specify the Persistent interface, this can be done a couple ways: 2.1 Either specify a base class (that in turn implements the Persistent interface) using castorbuilder.properties. This can be done with the current Castor version or older versions. -or- 2.2 Grab the CVS version of Castor and use a binding file that specifies at fine grain level the interfaces to implement for each class. There is an of using a binding file in the examples/SourceGenerator directory. For the complete schema for the binding file see bug #882 (http://bugzilla.exolab.org/show_bug.cgi?id=882) Hope that helps, --Keith > Ross Larner wrote: > > RL>I am a fairly new user to Castor, and I have a basic question I > hope someone could > answer: > RL> > RL>is there a way to have Castor autogenerate the Java classes that > implement > Persistent from an XSD? > RL> > RL>For example, the Product.java file that is used in the jdo example > - could this > type of file be generated from an XSD using the sourceGenerator? It > seems very similar > to the XML Binding files that are generated by default. I am wondering > if anyone > autogenerates the JDO code as well, and if so, how? > RL> > ------- > BS>Ross, > > BS>See Castor XML's SourceGenerator: > > BS> http://www.castor.org/sourcegen.html > > BS>It's possible that there may still be some very minor issues with > what > BS>it generates and whether it's fully compatible with JDO. > > BS>Bruce > > Bruce, et all, > I was under the impression that the SourceGenerator only generates > files for use in the XML Data Binding part of Castor, nothing for the > JDO stuff. After reading the link you sent, as well as the pdf doc for > the Source Generator, I didn't find anything to refute that. Is there > anything that autogenerates the JDO code from an XSD, i.e. generating > the Java classes that implement "Persistent"? > > Thanks again, > Ross > > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev