Hi all. I'm a bit of a newb to Hibernate and really like what I’m finding. However, I’ve got a bit stuck on the following issue using Hibernate 3.1.
I have two configuration files each initialised with their own SessionFactory (due to their being 2 separate databases). One .cfg is mapped to our static data database and has an object called CurrencyData in it. The other .cfg initialises my Asset.hbm.xml file which in turn describes the relationship with CurrencyData as an attribute in the following manner:
Code:
<many-to-one name="Currency" class="eg.currency.CurrencyData" column="CurrencyID" lazy="false" />
Issue I have is that because CurrencyData is mapped in my Static.cfg and Asset is in my Asset.cfg file I get binding errors when I try to reference the AssetData complaining that CurrencyData doesn’t exist. It does exist, but in a different SessionFactory.
Is what I’m attempting to do feasible? Is there some part of Hibernate I’m not understanding? Is there a “global” view of session factories which can resolve this?
Any help on this but would be really appreciated.