-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate POJO class transmiting error between c/s
PostPosted: Sat May 28, 2011 4:08 am 
Newbie

Joined: Sat May 14, 2011 2:08 am
Posts: 1
Hi !
Recently I wsa confused of an error while I am trying to transmit a pojo class(User) to client(developed by android SDK) point by sequence class
as following error:
java.io.invalidClassException:org.hibernate.collection.PersistentSet:Incompatible class(SUID)错误

package com.demo.hibernate.beans;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import org.apache.commons.lang.builder.ToStringBuilder


and this is the User pojo class
[code]

/** @author Hibernate CodeGenerator */
public class User implements Serializable {

/** identifier field */
private Integer userId;

/** persistent field */
private String userName;

/** nullable persistent field */
private String password;

/** nullable persistent field */
private byte[] picture;

/** nullable persistent field */
private Date lastLogout;

/** persistent field */
private Set albums;

/** persistent field */
private Set comments;

/** persistent field */
private Set photos;

/** persistent field */
private Set friends;

/** full constructor */
public User(Integer userId, String userName, String password, byte[] picture, Date lastLogout, Set albums, Set comments, Set photos, Set friends) {
this.userId = userId;
this.userName = userName;
this.password = password;
this.picture = picture;
this.lastLogout = lastLogout;
this.albums = albums;
this.comments = comments;
this.photos = photos;
this.friends = friends;
}

/** default constructor */
public User() {
}

/** minimal constructor */
public User(Integer userId, String userName, Set albums, Set comments, Set photos, Set friends) {
this.userId = userId;
this.userName = userName;
this.albums = albums;
this.comments = comments;
this.photos = photos;
this.friends = friends;
}

public Integer getUserId() {
return this.userId;
}

public void setUserId(Integer userId) {
this.userId = userId;
}

public String getUserName() {
return this.userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public String getPassword() {
return this.password;
}

public void setPassword(String password) {
this.password = password;
}

public byte[] getPicture() {
return this.picture;
}

public void setPicture(byte[] picture) {
this.picture = picture;
}

public Date getLastLogout() {
return this.lastLogout;
}

public void setLastLogout(Date lastLogout) {
this.lastLogout = lastLogout;
}

public Set getAlbums() {
return this.albums;
}

public void setAlbums(Set albums) {
this.albums = albums;
}

public Set getComments() {
return this.comments;
}

public void setComments(Set comments) {
this.comments = comments;
}

public Set getPhotos() {
return this.photos;
}

public void setPhotos(Set photos) {
this.photos = photos;
}

public Set getFriends() {
return this.friends;
}

public void setFriends(Set friends) {
this.friends = friends;
}

public String toString() {
return new ToStringBuilder(this)
.append("userId", getUserId())
.toString();
}

}

[/code]
this pojo class was generated automatically by middlegenIDE
Before I started to transmit this pojo I also gave the client project a hibernate3.jar reference.

Is there anybody could help me ?? thank you in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.