JPA Object Compatibility for SQL Server and Oracle (Auto-increment Issues)

I am developing a Java EE JBoss service that will be deployed in two different environments: one using SQL Server as the database and the other using Oracle 10g.

My database schemas are very similar, except that the primary key columns are automatic identity increment in SQL Server and are generated using sequences in Oracle.

With JPA, is it possible to use one set of objects with two DBs?

Thank!

+3
source share
1 answer

, , PK XML, . 2 "orm.xml", , , "persistenceUnitOracle" Oracle, orm-oracle.xml "persistenceUnitSqlServer" SQLServer, orm-sqlserver.xml

+4

Source: https://habr.com/ru/post/1794783/


All Articles