Justin,

On Fri, 09 Jul 2004 13:24:50 -0400, Justin Permar wrote:

>
>Werner Guttmann wrote:
>
>>Justin,
>>
>>if you were to use Castor JDO as persistance framework, the solution would be 
>>simple: write a mapping file for the 
>>classes generated, and map them to the corresponding tables.
>>
>>Werner
>>
>>On Fri, 09 Jul 2004 11:12:12 -0400, Justin Permar wrote:
>>>TWIMC,
>>>   What I would like to do is start with an XML schema, generate an 
>>>object via the source generator that is persistable. As an example, 
>>>generate an object with appropriate xdoclet tags in the file so that it 
>>>is persistable via hibernate. The goal is a seamless persistence 
>>>mechanism for all XML data. Is such a thing possible with current castor 
>>>(or possible with some modification, such as generation of hibernate 
>>>xdoclet tags in the generated objects that can then be processed to 
>>>produce hibernate mapping files)?
>>>   Thanks in advance.
>>>
>>>Justin
>>
>I believe (correct me if I'm wrong) that the same solution would work 
>for Hibernate. However, I'm really looking for a way to generate that 
>mapping file (there currently is no database schema that I have to 
>adhere to, so any mapping is fair game).

Two options come to my mind:

a) Use XDoclet on the generated classes, after you've added tags.
b) Use Castor's MappingTool. There's been a quite recent thread on castor-user that 
shows how to use it.

>The actual persistence 
>implementation is unimportant to me, so if generating the mapping for 
>Castor JDO is easier, that's excellent.
>
>It may be that what I'm actually looking for is a mapping from XML 
>schema to java objects to relational schema. It seems JAXB/Castor 
>generator solves the XML -> Java objects side of things, and Castor 
>JDO/Hibernate solves the Java objects -> persistence problem, but the 
>java objects in each case are different.
Are they ? They do not have to be, if if there's a difference, all you need is a bit 
of glue in between, which could be done in many ways.  

>I'm interested in generating a 
>Java object from the XML schema that can also be used directly for 
>persistence.
Just create a mapping file that suits you specific needs. But I cannot see why you 
could not map this class hierarchy to a database scheme.

>If there is any work going on this area, I would appreciate 
>any and all pointers (or if you know this problem is currently not being 
>tackled, please let me know so I can get started trying some things 
>out). I'm especially in any standards in that area, so as to avoid the 
>brittleness of serialization.
>
>Justin



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to