Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:31:41+00:00 2026-06-03T20:31:41+00:00

i have 3 classes, Recommendation, Judgement, User, the relationship are: one recommendation might have

  • 0

i have 3 classes, Recommendation, Judgement, User, the relationship are: one recommendation might have multiple judgements, one user might have multiple judgements(on different recommendation), here are my JPA classes:

Class Recommendation

@Entity
@Table(name = "RECOMMENDATIONS")
public class Recommendation implements Serializable, Cloneable {
...

@OneToMany(cascade = {CascadeType.REFRESH, CascadeType.DETACH }, fetch = FetchType.EAGER, mappedBy="recommendation", targetEntity=Judgement.class)
private Set<Judgement> judgements;

    ...
    public Recommendation() {
        super();
        this.judgements = new LinkedHashSet<Judgement>();
    }
   ...
}

class User:

@Table(name = "USERS", uniqueConstraints = @UniqueConstraint(columnNames = "email"))
public class User implements Serializable, Cloneable {
...
    @OneToMany(mappedBy="judge", targetEntity=Judgement.class, cascade = { CascadeType.REFRESH, CascadeType.DETACH }, fetch = FetchType.EAGER)
    private Set<Judgement> judgements;
...
    public User() {
        super();
        this.judgements = new LinkedHashSet<Judgement>();
    }

...
}

class Judgement:

@Entity
@Table(name = "JUDGEMENTS")
public class Judgement implements Serializable, Cloneable {
    @ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.DETACH})
    @JoinColumn(name = "id")
    private Recommendation recommendation;

    @ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.DETACH})
    @JoinColumn(name = "user_id")
    private User judge;
...
    public Judgement() {
        super();
    }
...
}

in db, i have the following tables:
users
recommendations;
judgements;

i have some data in users, and some in recommendations, but empty in judgements table, when i loaded my application got the following exception:

com.google.gwt.user.client.rpc.SerializationException: Type 'org.hibernate.collection.PersistentSet' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = []

i debugged the code turned out when load the judgements field for the recommendation record, it cannot instantiate it. Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:31:43+00:00Added an answer on June 3, 2026 at 8:31 pm

    Objects containing database entities, which are loaded by hibernate, are not serializable. As a consequence they can’t be used as transfer objects for gwt remote procedure calls.

    The simplest solution is to copy all content from the entity instances (in your case instances of Recommendation, Judgement and User) into simple data holder objects and use the holder objects as parameters in the remote procedure calls. For small projects that is a good solution. For bigger projects you can consider of using the Gilead library; in that case you even can profit of lazy loading.

    Google provides a good documentation of the integration of hibernate into GWT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have classes that are named exactly the same across different plug-ins that I
I have classes structured like this: Public MustInherit Class A ' several properties End
If I have classes of Type A and B: public class A { public
Assume I have classes A1 and A2 and a class B that has elements
I have multiple sub-domains within the document_root. And multiple folders/classes within those sub-domain folders.
I have existing C++ lib containing many different classes working together. Some example usage
I have a class file that contains all the classes that are needed for
I have classes Video and Audio , which extend class Popular In class, Video
I have classes which have automatic properties only like public customerName {get; set;}. They
I have classes that are needed in both my web service and my server.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.