Natural « Composite « JPA Q&A





1. Hibernate - Composite Natural Key - Alter Data gets -532 SQL Code    stackoverflow.com

We are using Hibernate in our system and it is working rather well except for one problem we are having in multiple areas. First of all this is a Java system using ...

2. One-to-many relations with composite natural keys    forum.hibernate.org

I'm having trouble building some mappings to my legacy database. I Can't work out how to build one-to-many mappings where both tables have natural composite keys. I have a lot of these to build, but once I've got one working, the rest should be easy. A simple example. I have two tables; currency and exchange rate. The essential parts of the ...

3. Natural keys using a composite-id best practices?    forum.hibernate.org

We are using natural keys in our data model and I was wondering what are healthy best practices? What makes our case a little unique is that we have other entity objects that share common columns in the primary key, plus an additional column or two. If the child object has reference to its parent, then using the foreign generator would ...

5. Of identifiers, natural, surrogate and composite keys    forum.hibernate.org

I'm trying to understand the performance implications of using an identifier (basically surrogate key) that has no business meaning, instead of using a natural primary key (composite key in my case). The Hibernate best practices says "there are all sorts of reasons why you should use identifiers" - i think i understand at least some of the benefits of using them. ...

6. composite / natural key    forum.hibernate.org

I have a key (Long) with autonumbering in a table but there is a combination of properties that is unique (String username + Long referenceToOtherTable + Date start + Date end) how can I do this withoud having a Component like this

7. Mapping a composite (natural) primary key    forum.hibernate.org

I have 2 tables that have identical composite keys. The 2 tables are mapped to domain objects and they both work as expected when treated individually. I would like (for convenience) to map them in a one-to-one relationship but I am having difficulty referencing the other's key using the property-ref. Here are my mappings: [code]

8. many-to-many and natural composite-id    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1 Mapping documents: ... ...