-->
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.  [ 1 post ] 
Author Message
 Post subject: Exporting Hibernate POJO to XML
PostPosted: Wed Aug 05, 2009 10:05 am 
Newbie

Joined: Wed Aug 05, 2009 9:52 am
Posts: 4
Hi,

I want to export Hibernate POJO to XML and vice verse. I am trying to use XStream as
xtream.toXML(//my POJO Object)

but my POJO class in complex. It has collection and recursive relation within objects. When I import this XML and want to persist POJO with hibernate, I face following issue

1. If ID already exist, hibernate complains. [Workaroung, I have set all id to null in xml]
2. Collection object can not be set.
3. Recursive relation are not setting.

Is there a better way to export/import POJO in xml, maintaining all relation in tact ?

I have followed steps from http://constc.blogspot.com/2008/03/xstr ... rnate.html but still issue is same.

Any help is greatly appreciated.

Thanks,
Datta


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

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.