tags:

views:

41

answers:

1

Hi, The 'DiscriminatorColumn' annotation isn't creating any column in my parent entity. Where am I going wrong ?

Here's my code

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING,length=20)
public class WorkUnit extends BaseEntityClass implements Serializable{

@Entity
@DiscriminatorValue(value="G")
@Table(name="Group_")
@PrimaryKeyJoinColumn
public class Group extends WorkUnit implements Serializable{
A: 

Try using @MappedSuperclass instead of @Entity on your abstract WorkUnit class.

lexicore
Hi. @MappedSuperclass doesn't create a separate table for WorkUnit; But I would like one.
soontobeared