-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Avoiding generated containts.
PostPosted: Fri Apr 16, 2010 8:47 am 
Newbie

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;
}
.....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.