Joined: Fri Apr 16, 2010 8:35 am Posts: 1
|
I am trying to use annotations to generate my DDL. I have everything working as I like except for one thing. When generating DDL for inherited classes the generated alter table SQL has an add contraint value that is generated like so:
alter table ANGELFISH add constraint FK71E495B9C27AFB7 foreign key (FK_ANGELFISH_FISH) references FISH;
I would like to add an annotation so I can control the value of the contraint. The following are the annotations I am using for the Fish class and the AngelFish class. I can't find anywhere in the documentation anything that addresses this. If someone knows how to control the contraint value I would appreciated a tip. Thanks.
@Entity @Table(name="FISH") @Inheritance(strategy = InheritanceType.JOINED) public class Fish implements Serializable { private static final long serialVersionUID = 1234567890L; private Integer id; @Id public Integer getId(){ return id; } public void setId(Integer id){ this.id = id; } .....
and here is the Angel Fish:
@Entity @Table(name="ANGELFISH") @PrimaryKeyJoinColumn(name = "ID") @ForeingKey(name = "FK_ANGELFISH_FISH") public class AngelFish extends Fish implements Serializable { private static final long serialVersionUID = 1234567890L;
private Integer finSize; @Column(name = "FINSIZE",length=100) public Integer getFinSize(){ return finSize; } .....
|
|