Hi,
I'm a newbie what concerns Hibernate and i'm experiencing some problems with inheritance and annotations...
I've read in the docs that the easiest way was the TABLE_PER_CLASS strategy, and that is what i would like to start with..
I have following Superclass:
Code:
@Entity
public class happening{...}
I have following SubClasses:
Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Activity extends happening{...}
Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class ActivityWithCard extends happening{...}
Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Exam extends Activity{...}
I read in the docs that you have to declare '@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)' on every leaf, so in this case Activity, ActivityWithCard and Exam. Though i always get a mappingexception: "Duplicate class mapping: duplicate found for class "Happening".
I've probably made some stupid mistake, I would be very gratefull if someone could help me out...
Much Thanks in Advance
El_Homer