yes, i see now, sorry :)
try this as in 8.1.6. *that* should work :)
<any name="Sender" meta-type="string" id-type="Int64">
<meta-value value="Employee" class="Employee"/>
<meta-value value="Friend" class="Friend"/>
<column name="SenderClass"/>
<column name="SenderID"/>
</any>
i wish i could imagine a nicer solution.. i tried mapping with conform
and it mapped it with any. used theese classes, and the mapping is
below. u can dl conform and try mapping with it :)
public class Entity
{
public virtual Guid Id { get; set; }
}
public class VoicemailMessage : Entity
{
public virtual IMessageSender Sender { get; set; }
}
public class Friend : Entity, IMessageSender
{
}
public class Employee : Entity, IMessageSender
{
}
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
namespace="AHummel_4Dva_Zadatak.Domain"
assembly="AHummel_4Dva_Zadatak.Domain" xmlns="urn:nhibernate-
mapping-2.2">
<class name="Friend">
<id name="Id" type="Guid">
<generator class="guid.comb" />
</id>
</class>
<class name="Employee">
<id name="Id" type="Guid">
<generator class="guid.comb" />
</id>
</class>
<class name="VoicemailMessage">
<id name="Id" type="Guid">
<generator class="guid.comb" />
</id>
<any id-type="Guid" name="Sender">
<column name="SenderClass" />
<column name="SenderId" />
</any>
</class>
</hibernate-mapping>
On May 18, 4:35 pm, Giulio Petrucci <[email protected]> wrote:
> Hi Alex,
>
> On Wed, May 18, 2011 at 3:34 PM, H.Alex <[email protected]> wrote:
> >http://knol.google.com/k/nhibernate-chapter-8-inheritance-mapping#
>
> > i think this would work.
>
> > <!--voice mail message mapping -->
> > <many-to-one name="Sender" column="SenderID" class="IMessageSender"/>
>
> It doesn't "as is". In fact, IMessageSender isn't mapped as it isn't
> part of any table hierarchy and I can't use it as a root hierarchy
> element for employee/friend as they're already involved in others
> hierarchy mappings. Or am I missing something else?
>
> Thanks,
> Giulio
>
> --
--
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.