Skip to main content

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

Hello

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?

@MappedSuperclass
public abstract class BaseEntity {
@Id
   @Column(name="id")
   private long id;

   public long getId() {
       return id;
   }

}

@Entity
@Table(schema="PLI", name = "PLI_CATALOG_PRODUCTS")
@DiscriminatorColumn(name="PRODUCT_TYPE")
public abstract class CatalogProduct extends BaseEntity{
  ......
  ......
}

Leon


Back to the top