database « Composite « JPA Q&A





1. Using a composite key in a many-to-many relationship in JPA    stackoverflow.com

I've got the following situation:

  • A User object has a Set of Permission objects (Set<Permission>)
  • Each User can have zero or more Permissions
  • A Permission object has three fields
  • The three fields of Permission make ...

2. hibernate composite key not working    stackoverflow.com

here is the code i am using:- Database:

 CREATE TABLE IF NOT EXISTS `btech_faculty_assigned` (
      `subject_id` varchar(8) NOT NULL,
      `year` varchar(4) NOT ...

3. Composite Primary Key Hibernate and Java Implementation    stackoverflow.com

I have defined a very simple database as follow : MySql Simple Database I'm using the hibernate plug-in to generate the different classes, including the one-to-many relationship between customer and order. ...

4. Hibernate cascade + composite id's issue    stackoverflow.com

I'm currently learning Hibernate, and I've stumbled into this issue: I have defined 3 entities: User, Module, Permission. Both user and module have a one-to-many relationship with Permission, so that Permission's composite ...

5. JPA/Hiber, legacy DB: composite keys and discriminator colum    forum.hibernate.org

Hello, I want to know hot to map in JPA/Hibernate with a legacy database a table containing two-columns composite keys, being one of them a discriminator column for a table-per-class hierarchy. I have a case similar to the one that appears in the book "Java persistance with Hibernate", chapter 8.1.1, section "Composite keys with annotations". I have to create a Java ...

6. Support for objects/db tables with composite ids/keys    forum.hibernate.org

Hi, I have a problem with lazy loading collections of objects with composite keys. I have the following 2 mappings: Code: ...

7. Workaround w/ DB returns composite-id key-property of null?    forum.hibernate.org

I'm encountering a problem when retrieving persisted objects from a legacy database where a subset of the columns in the composite ID are null (i.e. last_name, see bellow). The row in the database is not hydrated and hibernate returns a null object. Is there a way to retrieve hydrated objects where these parameters are simply null? Thanks, PT Hibernate version: 3.0.1 ...

8. Composite key with strange results in DB    forum.hibernate.org

Hi, I'm trying to persist a composite-id class which is composed out 2 fields as primary key. This isn't the first time I'm using composite class, so I think how it should work. I have used it on the same database, except this is another table. This time I'm facing a very strange problem: When I inspect my object in Eclipse, ...