Regular |
 |
Joined: Fri Nov 07, 2003 6:31 am Posts: 104 Location: Beijing, China
|
I need to be able to force ID on tables using Identity generator. While I can control the database (set IDENTITY_INSERT ON & OFF in my case on SQLServer), I can't tell hibernate to actually put the ID field in the generated queries.
The best solution I can see would be to extend IdentityGenerator and add a verification: is the ID field is not NULL, include it in the query.
Does any body has experience in implementing IdentifierGenerator?
If the contract is simple, the IdentityGenerator implementation is quite complexe.
And I don't see why not, but if someone think my solution wouldn't work please let me know!
_________________ /nodje
|
|