Foreign key « Property « JPA Q&A





1. Foreign Key Property    forum.hibernate.org

Suppose I have this: is there a way for Hibernate to get the actual value of the foo_id, rather than the foo object without also adding a seperate for the foo_id value in the mapping file? I don't want to have to load the foo object just to get its id. ...

2. proper usage of property-ref - what does foreign-key?    forum.hibernate.org

How can that happen? I define a set of unique attributes with a element in Cgtdet and try to reference it by property-ref from ActObjve. But instead, hibernate tells me that the number of columns of the referenced primary key (!!) is wrong. Surely it doesn't match - but that's why I want to use the alternate key "CtgtdetCompositeKey" as ...

3. Possibility to declare foreign keys for properties    forum.hibernate.org

Hi, I'm using hibernate 3.3.1.GA with annotation 3.4.0.GA to access a local mysql database. Currently I also use hibernate to create/update my database during program startup by setting the "hibernate.hbm2ddl.auto" property to "update". But unfortunately I have some objects which use only the Integer or Long primary key to reference an associated object - e.g. Code: class A { ...