Hibernate version:
3.2.5.ga
Name and version of the database you are using:
Oracle
I have a table with a primary key 'id' and an alternate key 'public key'. The primary key column gets its values from one sequence and the public key gets its value from another sequence.
How can I specify this in my mapping file? I can use a sequence generator for the id column, but I need another sequence generator for the public key column, and the mapping file only allows one id/generator.
Is this a situation to use a
Generated Property? It doesn't seem like it, because the public key value is not determined by a trigger. Typical sql for inserting a row would be something like:
Code:
insert into mytable (id, public_key, blahblah) values ((select ID_SEQ.NEXTVAL from dual), (select PUBKEY_SEQ.NEXTVAL from dual), ?)
Changing the table schema is not an option.