Hi,
We are developing a system, which is a set of modules, each module has their schema (domain tables set) and their business java component. All modules need some information from the others.
The interaction in some cases is using webservices, but in another cases it's needed in data layer (multi-schema joins).
Example of modules are: 1. People central DB 2. Contracts Branch One (it needs info from people, it has very specialized business process and different data, the contract's objective is to refer a person.) 3. Contracts Branch Two (as above, the contracts are similar, but the items involves "build-houses" as real state, some person is the owner) 4. Contracts Branch Three (as above, the contracts are similar, but the items involves "cars", some person is the owner) 5. Invoice central (it needs data from people (holders/owners) and the Contracts modules (general info).
We've tryed mapping with hibernate, using @Table-schema, but every test it runs, it create a table in the foreign schema, and can't map a view because hibernate use it like a table.
It could be a good solution to have a non-persitent Entity to allow to map a table from a foreign schema in a join. ¿Is it exists something like that or a work-arounding solution?
Moreover, using named native queries, it's possible to map a multi-schema join, but the 'foreing' fields can't be mapped to transient fields. However, using that field a persistent-one, it works but it implies to add another local table, instead a view or table outside its schema.
¿Do you have a suggestion?
Thank you in advance for any tip or advice.
Fernando.
|