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

  • SEARCH
  • Home
  • 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 8856709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:24:59+00:00 2026-06-14T14:24:59+00:00

I have a base class entity that looks like this: @Entity @Inheritance(strategy = InheritanceType.JOINED)

  • 0

I have a base class entity that looks like this:

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "IDTYPE",
    discriminatorType = DiscriminatorType.STRING,
    length = 12)
public class ProtoObject implements Serializable {

  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @Column
  private String              idtype;

  // more columns

I have a number of sub-classes of this that I build and persist. However I have found that even though idtype column gets set to what I would expect in the data base (checking with a separate DB browser tool) the Java objects idtype property does not get set for those object that the EntityManager has in its cache.

If I do a find of objects through the EntityManager, the most recently persisted objects appear to have idtype blank! If I close the application and re-open it the data appears OK.

This is a JSF 2 application using EclipseLink 2.3.2.v20111125-r1046.

Is this a known problem and can anyone suggest a work-around?

  • 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-14T14:25:00+00:00Added an answer on June 14, 2026 at 2:25 pm

    You didn’t set the attribute when you created the object to reflect what you wanted pushed to the database. You need to set the field to keep it consistent in the cache as JPA Entities are treated as regular java objects and won’t fix things for you. Or after persist you can flush the changes them refresh the object to have the field populated with what is in the DB

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

Sidebar

Related Questions

I have a base class that looks like this: public abstract class MyBaseClass {
I have a base repository that looks like this: public class BaseRepository<T> : IBaseRepository<T>
In the project I'm working on now, we have base Entity class that looks
I have an entity class and a subclass based on that entity: @Entity @Inheritance(strategy
I have an entity model where the base class in an inheritance structure has
I have a base class like this: public class BaseResponse { public string ErrorMessage
I have a model that looks like this: public interface IEntity { int Id
I have created a backend for my google app that looks like this: backends:
I have a base class for all my entity types which is like public
I have a simple class that provides state codes like this: public class StateProvider

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.