Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink mapping question

Hi Leon,

I suspect that removing the @DiscriminatorColumn(name="PRODUCT_TYPE") annotation will solve your problem.

In this case it looks to me like you are trying to inherit an attribute rather than implement inheritance. The DiscriminatorColumn is used for JPA Inheritance.


Leon Derks wrote:

I have the following problem:

I defined a BaseEntity for all my Entity classes. This BaseEntity class contains only the id.
In this way I don't need to define id variables in every Entity class.

I have a CatalogProduct class which extends the BaseEntity class.
But when I run the query for an entity, for example: em.createQuery("select p from CatalogProduct p").getResultList(), it always tries to select from the BaseEntity table which doesn't exist.

What is causing the problem?

public abstract class BaseEntity {
   private long id;

   public long getId() {
       return id;


@Table(schema="PLI", name = "PLI_CATALOG_PRODUCTS")
public abstract class CatalogProduct extends BaseEntity{

eclipselink-users mailing list

Back to the top