-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: class2hbm
PostPosted: Wed Jun 09, 2004 1:52 pm 
Newbie

Joined: Wed Jun 09, 2004 1:40 pm
Posts: 2
class2hbm breaks on some castor generated beans that I am trying to generate mapping files from.

Is there any other tool that generates the mappings file automatically from a java bean or an xml schema?

James


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 7:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
class2hbm is no longer supported and is/has been dropped from Hibernate 3.x and on. I'm not aware of any (other) tools that can do this - in anycase there is not enough information in a class file to do it well. Why don't you generate them from the database - use Middlegen.


Top
 Profile  
 
 Post subject: class2hbm
PostPosted: Thu Jun 10, 2004 12:25 pm 
Newbie

Joined: Wed Jun 09, 2004 1:40 pm
Posts: 2
david wrote:
class2hbm is no longer supported and is/has been dropped from Hibernate 3.x and on. I'm not aware of any (other) tools that can do this - in anycase there is not enough information in a class file to do it well. Why don't you generate them from the database - use Middlegen.


I use wsdl or xsd documents as my design tool and find both axis wsdl compiler and castor xsd compiler very useful. In time I will move furtehr up the design tree to uml and xmi.

However from my playing around with collections and associations, I am not sure how feasible this approach is.

Initially everything went well. With an xml element that contained just an array of other elements, the composite-element relationship approach mentioned in the Parent/Child example (ch 16) worked really well.

However when the nested xml element itself had nested elements, the composite-element does not work (I think this is what caused the class2hbm to blow up).

In theory I could use a bidirectional one-to-many construct in the child classes to handle this, but then I have to generate a reference back to the parent xml element in the child xml element which feels clumsy. The only way I could get this to work is to declare the parent element to be minOccurs="0" and fill in the reference property in the generated java bean before I do the hibernate save; it feels very clumsy.

Do you think creating mapping files for generated axis or castor classes is feasible?

Is there any one else out there using wsdl or xsd compiler to generate beans that are mapped into hibernate?

James


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.