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
|