-->
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: Should objects implement serializable?
PostPosted: Sun Mar 16, 2008 6:46 pm 
Newbie

Joined: Sun Mar 16, 2008 6:39 pm
Posts: 4
In the Hibernate Annotation reference doc all of the classes implement serializable. Everything seems to work fine without it, so is there any need for it?

Thanks
Jason


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 16, 2008 7:18 pm 
Newbie

Joined: Sun Mar 16, 2008 6:39 pm
Posts: 4
BTW
By "all of the classes" I am talking about the persisted domain objects.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 1:34 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
I don't think Hibernate doesn't need the objects to be serializable (with the possible exception of any composite-id mapping objects).

That said, a lot of people need to make their domain model classes Serializable because they use it for lots of other stuff.

Lots of things you can do with the domain model will force you to need to make them serializable:
- marshalling them across a network connection using ordinary java serialization (i.e. using them as params to EJB calls, or other kinds of RPC mechanism).
- chucking them in a HTTP session: a lot of the app servers (possibly the standard, dunno) require the objects you stick in the session to be serializable

_________________
Cheers,
Shorn.


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.