Joined: Thu Apr 03, 2008 3:44 am Posts: 1
|
Hi all,
i am new in this forum.
I am studying hibernate annotations and would like to undersrand of to map a simple relation between 2 tables.
The table are :
Table User (
username PK;
..
..
..
)
Table Session (
operator PK
username_fk FK PK
...
...
)
The realtion is User -> Session (OneToMany so that a user can have many sessions)
In the second table i have a composite primary key made up of a Foreign key member;
Now i did not find a way to map it with hibernate annotations.
I use an Embeddable class to map the composite primary key.
Can someone help me with a little functioning sample code?
Thanks in advance.
|
|