I ran into a simillar problem when I had a Generic address object that
I needed to map to different places depending on which parent it was
associated with (the address stored with my user was in a UserAddress
table but once they created an order it would be stored in an
OrderAddress table as an example).

I gave up trying to find a solution and ended up denormalizing and
just using a component since right now I only had a need to store a
single address, but after I got this all working, I came accross the
join command and wonder if this would work.


<join table="Sender">
<key/>
<component ..../>
</join>

If you get this to work let me know I'm kind of curious.

On Sep 27, 4:44 am, Victor Toni <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have an existing schema which I cannot change which looks similar to
> one below.
> What this schema does is to map the "receiver" and "sender" to an
> EVENT.
> "receiver" and "sender" are actually a "Contact" which can consist out
> of an INDIVIDUAL and/or ENTITY
>
> EVENT table:
> KEY, data1, data2, ...
>
> INDIVIDUAL:
> KEY, FK_EVENT_SENDER, FK_EVENT_RECEIVER, data1, data2,....
>
> ENTITY:
> KEY, FK_EVENT_SENDER, FK_EVENT_RECEIVER, data1, data2,....
>
> Of the foreign keys exactly one is not null for a given row.
> So for a given structure the result should be
>
> event.Sender = contact1 (a "Contact")
> event.Receiver = contact2 (a "Contact")
>
> contact1.Entity = entity1 (using ENTITY.FK_EVENT_SENDER)
> contact1.Individual = indiviual1 (using INDIVIDUAL.FK_EVENT_SENDER)
>
> contact2.Entity = entity2 (using ENTITY.FK_EVENT_RECEIVER)
> contact2.Individual = indiviual2 (using INDIVIDUAL.FK_EVENT_RECEIVER)
>
> If the schema was open to discussion I would have used a CONTACT table
> but this is not an option here.
> My fallback idea is to use something like "Receiver : Contact" and
> "Sender : Contact" just as marker classes (which I don't like but
> could work)
>
> Any help how I can do this will be greatly appreciated.
>
> Kindest regards,
> Victor
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to