-->
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.  [ 5 posts ] 
Author Message
 Post subject: Serialization
PostPosted: Sat May 06, 2006 6:47 am 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
Hi All,
I searched the forum, but didn't find this issue solved

I try to serialize my object graph (in order to pass it to the servlet, which is working with POJOs and unaware of Hibernate).
I tried binary and xml serialization, but I'm not completely able to rid off all Hibernate staff (proxy, PersistentCollection,etc.).

Do you know way/tool that allows to convert Hibernate objects into real POJOs? or some working converter for XStream?

(In the worst case, I will implement Externalizabe and will transform by myself, but I don't want to reinvent the wheel..)

Thank you,
Igor Laberov


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 06, 2006 6:44 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Why do you want to serialize it? You can initialize all important properties and it it should be fine.
Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 07, 2006 2:36 am 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
I need to pass my persistent objects as POJOs to the applet ( I mistypes in my previous post) and I don't write marshall method for each class in the domain


Top
 Profile  
 
 Post subject: I'm using XStream
PostPosted: Sun May 07, 2006 5:54 pm 
Beginner
Beginner

Joined: Thu Jun 23, 2005 4:11 pm
Posts: 24
I'm using XStream to send pojos from hibernate queries to a client over a socket. I think the only thing you have to worry about is that all your objects are initialized, and are not using lazy-loading.

I ensure that properties/collections are initialized, but now I wonder if the XStream serializer would actually trigger hibernate to initialize lazily-loaded properties/collections when calling getters, or if it uses reflection. I'm not using any special XStream converters, except for a custom date parsing converter which is unrelated.


Top
 Profile  
 
 Post subject: Re: I'm using XStream
PostPosted: Sun May 07, 2006 11:46 pm 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
genekhart wrote:
I'm using XStream to send pojos from hibernate queries to a client over a socket. I think the only thing you have to worry about is that all your objects are initialized, and are not using lazy-loading.

I ensure that properties/collections are initialized, but now I wonder if the XStream serializer would actually trigger hibernate to initialize lazily-loaded properties/collections when calling getters, or if it uses reflection. I'm not using any special XStream converters, except for a custom date parsing converter which is unrelated.


Is your client aware of Hibernate jars? I'm asking because XStream put Hibernate classes names in the xml (e.g. PersistentBag for collections), and on client end it is not possible to deserialize this xml due to lack of hibernate jars


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.