-->
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.  [ 4 posts ] 
Author Message
 Post subject: Under what condition to implement Serializable?
PostPosted: Sat Aug 07, 2004 12:50 am 
Regular
Regular

Joined: Mon Aug 02, 2004 9:33 am
Posts: 69
Hibernate version:2

public class Country implement Serializable
{

private int id;
private String name;

public Country() {
}

public int getId() {
return this.id;
}

public void setId(int newId) {
this.id = newId;
}

public String getName() {
return this.name;
}

public void setName(String newName) {
this.name = newName;
}
}

Sorry I am newbie to Hibernate !!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 07, 2004 5:03 am 
Regular
Regular

Joined: Wed Nov 26, 2003 6:22 am
Posts: 76
Location: Stockholm
You just have to be a little more verbose!

Are you asking when to implement Serializable in you POJOs?
In that case the answer is: when you want to use them in some kind of webapp or send them over network. Hibernate per se does not require the POJOs to be Serializable, I think.

/C


Top
 Profile  
 
 Post subject: Hibernate need POJO to be Serialized?
PostPosted: Tue Aug 17, 2004 11:32 pm 
Regular
Regular

Joined: Mon Aug 02, 2004 9:33 am
Posts: 69
So do u think Hibernate need POJO to be implemented Serialize?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 11:37 pm 
Regular
Regular

Joined: Wed Nov 05, 2003 10:57 pm
Posts: 96
Hibernate does not require POJOs to implement Serializable. If for example you put the POJOs in HTTPSession or send them over the network then they need to serializable.

mota


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