I am a new Hibernate (v3) user. Having checked the internet (including this forum) and the Hibernate in Action book, I'm still unsure if this scenario can be handled via a Hibernate mapping file.
Scenario: The Oracle database table we are mapping to has a primary key that includes two columns: one id that should be generated (e.g. Hibernate's sequence generator), and another customer code that is required to be on all tables. Other tables have a foreign key to the generated id and customer code. I realize that this design might not be desirable, but the DBA insists this is needed.
It appears that the <composite-id> does not allow the generator tag as the <id> element allows. It seems that I could create a CompositeUserType, but I cannot find how to produce and use the Hibernate generated id.
I cannot see more than one result page from either my Internet Explorer browser or FireFox browser. So, if this has been answered previously, please provide me the link.
Thanks in advance for any help.
|