-->
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: Hibernate collection Class replacement disable
PostPosted: Thu Jan 25, 2007 11:48 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 1:52 pm
Posts: 40
I have some classes that have collections in them. I create and populate them which works fine. Then when I save, hibernate replaces the normal ArrayList and HashSet, etc. collections with hibernate internal versions. Is there any way to prevent this replacement? What is the purpose of it if hibernate can already handle persistence of the regular java util collections?

I am serializing my hibernate objects so I want to not have to serialize these hibernate collection classes as well.


Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 1:59 pm 
Beginner
Beginner

Joined: Sat Dec 16, 2006 1:52 pm
Posts: 40
Bump. Please excuse my "nevermind." In fact hibernate does replace classes. Anyway to stop this?

This causes me to need to serialize the hibernate collections too. Along with any exceptions they may throw. Its hard on my RMI system. It forces me to control the loading of my classes since remote loading of classes can toss a runtime exception just because the net cable came unglued...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 4:50 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
No.
Hibernate will not work, as it needs to distinguish between initialized and not initialized list/sets etc.
See the discussion here
http://forum.hibernate.org/viewtopic.php?t=946665&highlight=serialize

The last approach in this discussion might be useful to you as well.

You may consider to create a dto object properly initialized to exchange data and then extract the information back in Hibernate objects .

_________________
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  
 
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.