Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Auto Increment in hibernate

843859Jun 20 2007 — edited Jun 21 2007
Hello every one,

i have to write the code that used for diffrent databases like oracle,sql-server2000..

the problem has generated at the auto increment field...
the problem is as follows....

1) Identity field in sql-server but not in oracle because for oracle it uses index

i try like
<id name="id" column="id">
<generator class="increment"/>
</id>
it works fine for oracle but not for sql-server and ....

<id name="id" column="id">
<generator class="identity"/>
</id>

it works fine for sql-server but not for oracle because the id field is not null and it gives error that null field is not allowed ....

is there any other solution....then please help me

thanks
pandev84
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2007
Added on Jun 20 2007
3 comments
690 views