Search code examples
javaoraclehibernatehsqldb

Hibernate with HSQLDB and Oracle


I have moved a group of tables to hsqldb for faster performance, however there are a few residual Many to 1 associations between the hsqldb tables and Oracle tables. Is it possible to configure hibernate to manage this type of association? Currently i'm using two persistence units, one for Oracle and the other HSQLDB.


Solution

  • Hibernate does not support relationships between different databases and certainly not databases of different types.

    You will probably have to manage the "fetch" of those related entities by hand, perhaps by converting the many-to-one to just raw foreign key values and then doing the fetch from the Oracle db (using a different SessionFactory if you are using hibernate for both).