Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] BaseEntity


This should work and the mapping I see below is correct. Is BaseEntity somehow mapped as an Entity? In XML maybe?


----- Original Message ----- From: "Leon Derks" <leon.derks@xxxxxxxxxx>
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Sent: Thursday, April 17, 2008 11:42 AM
Subject: [eclipselink-users] BaseEntity


Is it possible to have one single BaseEntity class that contains a general used id for all other entity classes?

Like this:
public abstract class BaseEntity {
@SequenceGenerator(name="seqGen",sequenceName="PLI_SEQ", allocationSize=1)
   private long id;

   public long getId() {
       return id;

And that all my entity classes are extending from this BaseEntity. Because then I don't need all kind of similar id variables in my entity classes.

I tried this, but it results in an error. Because it wants to select from the table BaseEntity and this doesn't exists of course.

Am I doing something wrong with my jpa mapping?

eclipselink-users mailing list

Back to the top