primary key « Collection « JPA Q&A





1. Collections and DB supplied primary keys    forum.hibernate.org

I have done some research on this (google, 'in action', and forums) but haven't found a definative best practice. I was looking for feedback on how to work with a collection of objects which do not yet have their key(id) defined. It is suggested that for one-many relationships the unordered type SET is the way to go. This works majestically in ...

2. Maping one-to-many collections on a non-primary key    forum.hibernate.org

Cheers for that, it's almost exactly what I needed. Unfortunately as I can't use bi-directional associations with it as Hibernate complains that there isn't a unique row for the parent reference (justifiably so). And uni-directional associations result in a spurious update to set the parent reference which isn't going to fly for us. Has anyone managed to get around this? Also ...

3. Collection filtering with compound primary keys    forum.hibernate.org

Newbie Joined: Mon Apr 28, 2008 12:30 pm Posts: 1 I am mapping a legacy db with compound primary keys all over the place. The security requirements fit with hibernate filtering. I am hitting a SQLException because the SQL generated is invalid. Is collection filtering not supported with compond primary keys, or am I doing something stupid? The structure being mapped ...