Entity keys: adding your own ids
Posted: Thu 04 Jun 2009 09:35
Hi,
I ran into the following problem: I have this legacy database with a table Foo. This table contains a technical Primary key ID.
In the past we called a stored procedure to get a range of ids from a sequence, assigned them and then persisted the rows in one batch insert.
Is there a way to override the key generation of a certain entity? So I can inject my own key generation algoritm?
Or is there a way change the entity keys before an insert takes place?
Thanks.
Best regards,
S
I ran into the following problem: I have this legacy database with a table Foo. This table contains a technical Primary key ID.
In the past we called a stored procedure to get a range of ids from a sequence, assigned them and then persisted the rows in one batch insert.
Is there a way to override the key generation of a certain entity? So I can inject my own key generation algoritm?
Or is there a way change the entity keys before an insert takes place?
Thanks.
Best regards,
S