Hello all,
I have to deal with an existing Oracle schema, which contains the table with 2 different unique keys. One of them is record# and should be generated from the sequence, another one is string entity Id, and I want to use it as a primary id.
Is this possible in JPA - to make it generate record # from the sequence when field is not marked as @Id? I tried, but it didn't work.
Maybe it's possible to do this manually in @PrePersist method? But how do I access Oracle sequence from the entity's member method? (The preferrable way is to use JPA only, using native SQL also may be acceptable)
Thank you
|