Nischala, if you asking about how to use the type org.exolab.castor.types.Date when mapping classes to a RDBMS schema, I am afraid this won't work out of the box .. ;-). Let me know what your (real) intention is, and we'll take care of your problem. It has just happened that we (the committers) discussed this very issue a couple of weeks ago, and the fix should be straightforward.
Regards Werner . On Fri, 4 Jun 2004 16:30:19 -0700, Nischala Kale wrote: >Looks like the link I posted contained an email address, and so was blocked. >Here is the question that was posted on castor-dev mailing list, message number >msg05772 >== >Hi, > >I have a schema that defines an xsd:date element. When I generate my objects from my >xml file, the representative object for xsd:date is org.exolab.castor.types.Date. > >Next, I using the MappingTool utility to generate a mapping.xml file, as I eventually >want to map these objects to an RDBMS. A snippet of the nicely formatted mapping.xml >file follows: > ><?xml version="1.0"?> ><mapping xmlns="http://castor.exolab.org/";> > <description>Castor generated mapping file</description> > > <class name="org.exolab.castor.types.Date" identity="" access="shared"> > <description>Default mapping for class org.exolab.castor.types.Date</des >cription> > <map-to xml="date"/> > <field name="content" type="java.lang.String"> > <bind-xml name="content" node="text"/> > </field> > </class> > >This looks ok to me. Anyhow, I then run my program and it fails on the setMapping() >method as follows: > > >org.exolab.castor.mapping.MappingException: The method getContent in class org.e >xolab.castor.types.Date accepting/returning object of type class java.lang.Strin >g was not found > at org.exolab.castor.mapping.loader.MappingLoader.createFieldDesc(Mappin >gLoader.java:719) > at org.exolab.castor.xml.XMLMappingLoader.createFieldDesc(XMLMappingLoad >er.java:260) > at org.exolab.castor.mapping.loader.MappingLoader.createFieldDescs(Mappi >ngLoader.java:519) > at org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(Mappi >ngLoader.java:343) > at org.exolab.castor.xml.XMLMappingLoader.createDescriptor(XMLMappingLoa >der.java:157) > at org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoa >der.java:212) > at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:278) > at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:234) > at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:224) > at Test.<init>(Test.java:53) > at Test.main(Test.java:34) > >The basic question is, how does one supply the appropriate mapping for an xsd:date? >I'm lost here. Thank you for your help. > > >-Doug >======= > > > -----Original Message----- > From: Nischala Kale > Sent: Fri 6/4/2004 4:17 PM > To: [EMAIL PROTECTED] > Cc: > Subject: how do I use mapping and a java.util.Date? > > > > Hi, > > I came across the same problem as the person in this Thread. As I did not > see any replies about the solution, I'm posting it again. Here is the link to the original question - > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg05772.html > > Can someone help? > > Thanks > > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
