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: newbie question - why implement Serializable
PostPosted: Tue Apr 04, 2006 1:13 pm 
Newbie

Joined: Tue Apr 04, 2006 1:00 pm
Posts: 8
Hi!

I'm new to Hibernate and I have been playing around with it a bit, and notised when I was using HibernateTool to do som reverse-engieneering that it implemented Serializable in most of my persistent classes.

Can any one tell me the reason for this?
When I manually reverse-engineer my classes, should I implement it as well?
Is it some 'rules' for when I should/should not be using Serializable?

Thanks in advance
Robert


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 04, 2006 1:28 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
You will need to implement Serializable if you need to serialize your objects (usually to send them via a socket or to write them to a file). If you don't need that you don't have to implement Serializable.

If later you try to serialize an object that isn't Serializable, you'll ge an exception.

Anyway, there's no punishement for implementing it and not using serialization :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 04, 2006 1:32 pm 
Newbie

Joined: Tue Apr 04, 2006 1:00 pm
Posts: 8
ah -I see!
Thank you! I think I'll use Serializable then :)


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.