TABLE_PER_CLASS inheritance and different sequences for id generation
I'd like to use the new table_per_class inheritance strategy for my parent and child class. Their @Id is a GeneratedValue(strategy=GenerationType.SEQUENCE). As they are mapped to different tables, they should each use a different sequence to generate the values for the @Id column.
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Mama {
@Id
@SequenceGenerator(name="MAMA_SEQ", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="MAMA_SEQ")
@Column(name="IDENT_LOCAL")
protected long ident;
.....
}
public class Child extends Mama{
@Id
@SequenceGenerator(name="CHILD_SEQ", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="CHILD_SEQ")
@Column(name="IDENT_LOCAL")
protected long ident;
....
}
Is it possible to use a different oracle sequence for id generation within the child?
Best Regards
Daniela Weil