I have the following entity:
@Entity
public class TestCaseStep implements JPAEntity<Integer> {
...
@Column(name="STEP_NUMBER")
private Integer stepNumber;
@Enumerated(EnumType.STRING)
@Column(name="ACTION")
private Action action;
**@ManyToOne
@JoinColumn(name="connector")
private ScriptItem connector;**
My attribute ScriptItem is a interface for 3 other classes. Is it possible to configure JPA to set the correct class id in runtime execution?
Other resources:
public interface ScriptItem {
String getValue();
ScriptItemType getType();
}
@Entity
@Table(name="DAT_FEED_XML")
public class FeedXml implements JPAEntity<Integer>, ScriptItem {
...
}
@Entity
@Table(name="DAT_DB_STMT")
public class DbStatement implements JPAEntity<Integer>, ScriptItem {
...
}
Which annotations should I use to let JPA understand that I want to save the id of one of the 3 classes?
Thanks in advance,