mardi 14 octobre 2014

Using ID generator "Sequence" or "Table HiLow" based on database


Vote count:

0




We are using Hibernate 3.2 and cannot upgrade due to dependency on other libraries being used in legacy applications. Currently, "native" id generator is being used in hibernate mapping file for table. In turn, hibernate uses "sequence" for Oracle and "Auto_Increment column" for MySQL. As application generates lot of Ids so in case of Oracle, to fetch next sequence lot of queries flows between database and application impacting performance. We would like to use HiLow for Oracle and would like to continue to use "Auto_Increment column" for MySQL.


Question is, How shall we define mapping file so as Hibernate should use HiLow if underlying database is Oracle and "Auto_Increment column" if underlying database is MySQL? If we cann't achieve this via mapping file, which class shall we override?



asked 38 secs ago

Stauz

184






Using ID generator "Sequence" or "Table HiLow" based on database

Aucun commentaire:

Enregistrer un commentaire