-->
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: Marshall / Unmarshall
PostPosted: Sun Nov 16, 2003 7:47 pm 
Newbie

Joined: Sun Oct 26, 2003 5:21 pm
Posts: 4
Hi,

Am I right by saying that Hibernate is not the correct tool if you want to map XML <-> Java, as opposed to Castor with its Marshall/ Unmarshall class ?

Otherwise, how can I map an XML file into a Java object ?

Please advice.

Thanks,
Benoit.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 16, 2003 7:49 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hibernate has only marginal marshall/unmarshall support for database im/export in the latest version. It is not the right tool for generic XML databinding.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 12:50 am 
Senior
Senior

Joined: Tue Sep 23, 2003 8:18 am
Posts: 137
Location: Johannesburg, South Africa
I use an XSD to generate my Java classes via JAXB. The only thing you would need to remember is that an XSD represents XML, which maps nicely to OO, but to get it to a state that Hibernate can work nicely with, you should add in the Relational elements if you are mapping to a RDMS, and of course, because of this, you need to make sure you do the child.setParent()'s yourself when you unMarshall, and inversely, do child.setParent(null) when you want to Marshall, otherwise you'll get stack overflow exceptions due to circular references.

Anyway, as Christian said, Hibernate is more to do with the datalayer.

-G


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.