PK « Column « JPA Q&A





1. How to join on none PK/FK columns using HQL?    stackoverflow.com

Using HQL, how do you join on columns (or object properties) that are non PK/FK? I'm reading the docs, and it seems it implicitly is going to join on the PK columns ...

2. many-to-many - not by PK column    forum.hibernate.org

Hi, I didn't find the way how to map the relation manyTomany, but not by PK column. All exemples for mapping the relation many-to-many is done based on PK column. I have a table Card(ID_CARD PK, CARD_NR) and table Promo( ID_PROMO PK, ...) The rows from column CARD_NR are distincts. So I want that in my intermediar table which represents the ...

3. simple update of one column based on PK    forum.hibernate.org

Hi i have just started using hibernate and am currently migrating an application to it. naturally there are many issues which with the help of the doc (excellent btw!!) and this forum's search, i'm getting through it. i am using hibernate v2.4.1 with postgresql v7.4.2. i have't posted my code or mapping doc as this is a 'generic' case. one thing ...

4. want many-to-one column to be in compsite pk.    forum.hibernate.org

I'm curious how you fix this. I have a similar problem. two tables tbl_user tbl_user_phone below is the user_phone table definition reate table tbl_user_phone( col_user_id INT NOT NULL, CONSTRAINT tbl_user_phone_col_user_id_fk foreign key(col_user_id) references tbl_user(col_id), col_phone char(10), col_prefered boolean, ); the column col_user_id is a foreign key to tbl_user and can allow for one to many relationships. I've tried to map this ...

6. Correct definition of a column that is both a PK and an FK    forum.hibernate.org

Hello, I have the following scenario: Schema: CAR --------------- CAR_ID [PK] NAME CAR_ATTR --------------- CAR_ID [PK, FK] NAME [PK] VALUE Auto generated classes: public class Car { private Integer carId; private String name; ... } public class CarAttr { private Integer carId; private String name; private String value; private Car car; ... } public class CarAttrPK { private Integer carId; private ...