what happen if a Person can work as Analyst and as Developer ?or as Analyst
and DBA ?

What a person can do does not change the Type of the person...
I mean an Animal can be a Cat or a Dog. A Dog can't be a Cat. A Dog can work
as "watch dog" or as "shepherd dog" but even it can work as both.

The inheritance express different type of thing and not different roles ;)


2009/7/16 graphicsxp <[email protected]>

>
> Hi,
>
> I can't figure out how to do my mapping.
>
> I have 3 tables :
>
> Person {PersonID, Name}
> Analyst{AnalystID, PersonID, Role}
> PersonAnalyst{PersonID, AnalystID}
>
> In my business model an Analyst inherits from Person. And a Person can
> holds a collection of Analysts.
>
> I've managed to map Person and Analyst (using a joined-subclass for
> Analyst) but I can't figure out how to map PersonAnalyst !  Can
> someone help me with it ?
>
> So far I've got that :
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> schema="TempCRM.dbo">
>
>  <class name="Metrica.Person, Metrica" table="Person">
>
>  <id name="Id" column="PersonID">
>    <generator class="identity"/>
>  </id>
>
>  <property name="Name" type="string" column="Name"/>
>
>  <!-- Description of an analyst entity -->
>  <joined-subclass  name="Metrica.Analyst, Metrica" table="Analyst"
> lazy="true">
>    <key column="PersonID"/>
>   <property name="Role" type="string" column="Role"/>
>  </joined-subclass>
>  </class>
> </hibernate-mapping>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
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