Thanks. Werner
wg> -----Original Message----- wg> From: Stefan Lober [mailto:[EMAIL PROTECTED] wg> Sent: Thursday, November 24, 2005 10:45 AM wg> To: [email protected] wg> Subject: RE: [castor-user] [XML/JDO] Problems using wg> ClassDescriptors and a mapping file wg> wg> Werner, wg> wg> I have created a new issue. wg> http://jira.codehaus.org/browse/CASTOR-1270 wg> wg> Stefan wg> wg> --- Werner Guttmann <[EMAIL PROTECTED]> wg> schrieb: wg> > Stefan, wg> > wg> > Can you please create a new issue at wg> > http://jira.codehaus.org/browse/CASTOR, and attach all wg> relevant files wg> > to replay your problem. Iow, at least the mapping file (relevant wg> > portions wg> > only) and the Java class as generated. If you could wg> follow the bug wg> > submission guidelines available at wg> > wg> > http://www.castor.org/how-to-submit-a-bug.html wg> > wg> > that would really help us wg> > wg> > FYI, I think I know what the problem is, but I need a wg> test case to wg> > play with, and I'd appreciate your help here (hence me wg> asking you to wg> > file a new bug report). wg> > wg> > Thanks wg> > Werner wg> > wg> > > -----Original Message----- wg> > > From: Stefan Lober [mailto:[EMAIL PROTECTED] wg> > > Sent: Mittwoch, 23. November 2005 12:51 wg> > > To: [email protected] wg> > > Subject: RE: [castor-user] [XML/JDO] Problems wg> > using wg> > > ClassDescriptors and a mapping file wg> > > wg> > > Werner, wg> > > wg> > > I have attached the stack trace. wg> > > wg> > > Regards, wg> > > Stefan wg> > > wg> > > --- Werner Guttmann <[EMAIL PROTECTED]> wg> > > schrieb: wg> > > > Stefan, wg> > > > wg> > > > Based upon Keith's comment, can you please post wg> > the complete stack wg> > > > trace ? wg> > > > wg> > > > Werner wg> > > > wg> > > > > -----Original Message----- wg> > > > > From: Keith Visco [mailto:[EMAIL PROTECTED] wg> > > > > Sent: Mittwoch, 23. November 2005 06:19 wg> > > > > To: [email protected] wg> > > > > Subject: Re: [castor-user] [XML/JDO] Problems wg> > > > using wg> > > > > ClassDescriptors and a mapping file wg> > > > > wg> > > > > Stefan, wg> > > > > wg> > > > > Type-safe enum style classes are generated wg> > without wg> > > > a default wg> > > > > constructor. Castor XML handles these types of wg> > > > classes, I wg> > > > > believe some work recently went into Castor wg> > JDO wg> > > > for wg> > > > > supporting them as well, but I don't know the wg> > > > extent of their support. wg> > > > > wg> > > > > wg> > > > wg> > > wg> > wg> http://castor.codehaus.org/xml-mapping.html#7.5-Type-safe-enum wg> > > > > eration-mapping wg> > > > > wg> > > > > wg> > > > > You can use descriptors with a mapping, but wg> > the wg> > > > mapping will wg> > > > > take precedence, so I recommend you remove any wg> > > > items from the wg> > > > > mapping file that you don't want to customize wg> > and wg> > > > then let wg> > > > > the descriptors handle the rest. wg> > > > > wg> > > > > If you want to override just one field and let wg> > the wg> > > > generated wg> > > > > descriptor do the rest, you can do the wg> > following: wg> > > > > wg> > > > > <class name="Foo" auto-complete="true"> wg> > > > > <field name="bar" handler="BarHandler"/> wg> > > > </class> wg> > > > > wg> > > > > Castor will load the FooDescriptor and then wg> > > > override the wg> > > > > associated bar FieldDescriptor with the above wg> > > > mapping. wg> > > > > wg> > > > > You can also specify a GeneralizedFieldHandler wg> > > > without a wg> > > > > mapping file if you use a binding-file during wg> > > > source generation. wg> > > > > wg> > > > > --Keith wg> > > > > wg> > > > > wg> > > > > wg> > > > > Stefan Lober wrote: wg> > > > > > Hello, wg> > > > > > I have built my project around Castor using wg> > an wg> > > > XML Schema wg> > > > > as starting wg> > > > > > point for my development. wg> > > > > > The development process is planned to be as wg> > > > follows: wg> > > > > > XSD => Java source (via SourceGenerator) wg> > Java wg> > > > source => wg> > > > > Java classes wg> > > > > > (Java compiler) Java classes => mapping file wg> > for wg> > > > XML&JDO wg> > > > > (MappingTool) wg> > > > > > wg> > > > > > I have modified the MappingTool class, so wg> > that wg> > > > it also wg> > > > > integrates JDO wg> > > > > > mapping information in my mapping file. wg> > > > > > The intention is to unmarshal an XML wg> > document wg> > > > (described by wg> > > > > the XSD) wg> > > > > > and persist it in the database. wg> > > > > > wg> > > > > > Unfortunately, a construct in the XSD causes wg> > > > some problems. This is wg> > > > > > it: wg> > > > > > wg> > > > > > <element name="state"> wg> > > > > > <complexType mixed="true"> wg> > > > > > <attribute name="id" type="int" wg> > use="optional" wg> > > > /> wg> > > > > > <attribute name="state-moment" wg> > use="required"> wg> > > > > > <simpleType> wg> > > > > > <restriction base="NMTOKEN"> wg> > > > > > <enumeration value="Unknown" /> wg> > > > > > <enumeration value="StateEnd" /> wg> > > > > > <enumeration value="StateBegin" /> wg> > > > > > </restriction> wg> > > > > > </simpleType> wg> > > > > > </attribute> wg> > > > > > <attribute name="stamptime" type="string" wg> > > > > > use="required" /> wg> > > > > > </complexType> wg> > > > > > </element> wg> > > > > > wg> > > > > > This element is referenced from a another wg> > > > element in the schema. wg> > > > > > wg> > > > > > First, I had let the SourceGenerator wg> > generate wg> > > > ONLY the wg> > > > > classes and NO wg> > > > > > class descriptors (with -gen-mapping and wg> > > > -nodesc). wg> > > > > > I get this mapping back from MappingTool: wg> > > > > > wg> > > > > > <class cst:name="log.State" wg> > > > > > cst:depends="log.Systemstates" wg> > cst:identity="id" wg> > > > > > cst:key-generator="MAX"> wg> > > > > > <description>Default mapping for class wg> > > > log.State</description> wg> > > > > > <map-to cst:table="State" cst:xml="state" wg> > /> wg> > > > <field wg> > > > > cst:name="valid" wg> > > > > > cst:type="boolean"> wg> > > > > > <sql name="valid" dirty="check" /> wg> > > > > > <bind-xml name="valid" node="attribute" /> wg> > wg> > > > > > </field> wg> > > > > > <field cst:name="id" cst:type="integer"> wg> > > > > > <sql name="id" type="integer" wg> > dirty="check" /> wg> > > > wg> > > > > > <bind-xml name="id" node="attribute" /> wg> > > > > > </field> wg> > > > > > <field cst:name="content" cst:type="string"> wg> > > > > > <sql name="content" type="char" wg> > dirty="check" wg> > > > /> wg> > > > > > <bind-xml name="content" node="element" /> wg> > wg> > wg> === message truncated === 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] -------------------------------------------------

