@Entity
@Table(name = "PERSON")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Person {
@Id
@GeneratedValue
@Column(name = "PERSON_ID")
private Long personId;
@Column(name = "FIRSTNAME")
private String firstname;
@Column(name = "LASTNAME")
private String lastname;
// Constructors and Getter/Setter methods,
}
Employee class extends Person
@Entity
public class Employee extends Person {
@Transient
private Date joiningDate;
// Copy Constructors and Getter/Setter methods,
}
The Employee class has only a transient object So I am not sure about using of @DiscriminatorColumn and @DiscriminatorValue, When i tried without using Discriminator that throws error
session.save(employee);
I am trying to save Employee object that throws Unknown column 'DTYPE' in 'field list' error