I ended up adding a view in the bar schema. the view only had the primary key from foo.FACILITY. then I used it as a joined subclass.
On Mar 15, 10:56 am, Erendrake <[email protected]> wrote: > I would like to start off saying that this board has saved me many > hours over the last few years. Most of the time my issues are simple > to look-up here or stackoverflow but this time the problem is > stickier. > > I have two oracle Schema for defining facilities, foo and bar. > * bar depends on foo and in some cases extends it. > * foo cannot see bar. > * foo and bar are in separate assemblies > * foo.FACILITY is the base class that i want to extend > > the mapping for foo.FACILITY follows > > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="foo" > namespace="foo" schema="FOO"> > <class name="Facility"> > <id name="Id" > > <column name="ID"/> > <generator class="increment" /> > </id> > <many-to-one name="Address" column="ADDRESS_ID" cascade="save- > update" /> > <many-to-one name="Location" column="LOCATION_ID" cascade="save- > update" /> > <property name="NumberOfAcres" column="NUMBER_OF_ACRES" > type="Decimal" /> > </class> > </hibernate-mapping> > > the problem stems from the fact that i don't have a bar.FACILITY table > to use for a joined-subclass. i have several many-to-many and one-to- > many relationships between tables in bar and foo.FACILITY > > forgive the incorrectness of what i am about to show, i am really not > sure how to map this. > > the bar mapping: > > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping namespace="bar" assembly="bar" > xmlns="urn:nhibernate-mapping-2.2" auto-import="false"> > <subclass name="Facility" extends="foo.Facility" > > <bag name="Programs" table="FACILITYPROGRAM" inverse="true" > lazy="true" cascade="delete"> > <key column="FACILITY_ID" /> > <many-to-many class="ProgramLookup" column="PROGRAM_FK" > unique="true"/> > </bag> > </subclass> > </hibernate-mapping> > > I don't have a discriminator in this relationship so i know that > subclass is incorrect. also this is a stable production dataset so i > am not able to afford to make major changes. > > Thank You, > Chris Woerz -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
