[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Relationship and Foreing Key

2006-06-26 Thread kapovolto
No one know how to eliminate Foreing Key constraint with annotation?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3953343#3953343

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3953343

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Relationship and Foreing Key

2006-06-21 Thread kapovolto
Hi.

It's possible to create a relationship (1to1, MtoN, 1toN) between two object 
without creating the foreing key constraint in the linking column?

ES:

Two Object, Person and Car. Suppose that a Person can have only 1 car at time. 
I make a 1 to 1 unidirectional association between Person and Car without 
ownership so Person can exist without a Car also Car can exist without a Person.

Code

@Entity
@Table(name = person)
public class PersonEntity implements Person {



@OneToOne
private CarEntity car;

.
}



@Entity
@Table(name = car)
public class CarEntity implements Car {

.

}

If I Deploy this code i found a colunm in Person table (Car_id) with the 
foreing key constraint on, so it's impossible to delete a car associated with a 
person and cathing the dangling reference by myself. 
Can i delete the foreing key constraint with Ejb annotation?

thanks.






View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3952438#3952438

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3952438


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user