batmat wrote:
It's not possible to write id generator for composite keys.
See
http://www.hibernate.org/hib_docs/v3/re ... ompositeidQuote:
You can't use an IdentifierGenerator to generate composite keys. Instead the application must assign its own identifiers.
In fact, it doesn't make sense to have generated composite keys: composite keys should be business manually assigned keys. Else when generated, it would be a lot more simple to define a simple column for the generated unique identifier.
Fair point. But I am trying to integrate with legacy database, a requirement is to still use composite keys and to to only assign them before the commit. The only way to do is to make the application code do it every time, this is cumbersome and bloats out the application code.
Comments appreciated.