| Author |
hibernate: id generator for column in composite key
|
sachin y deshpande
Greenhorn
Joined: May 12, 2004
Posts: 20
|
|
I have a table which looks like this: t1col1 not null t1col2 auto generated indentity t1col3 and (composite) primary key = t1col1, t1col2 i created a hbm which looks like: Problem is t1col2 is auto generated. How should this be specified in hbm? Thanks in advance [ Edited to use code tags - Paul Sturrock ] [ April 13, 2007: Message edited by: Paul Sturrock ]
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
With composite keys your only key generation strategy is "assigned". Neither Hibernate nor the database can know anything about the business logic you require to generate your composite key. That aside, if your composite key contains an identity field (which will have all the properties of a surrogate key) why are you using a composite key at all?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: hibernate: id generator for column in composite key
|
|
|