Hi,

I'm trying to map 5 tables to my domain model :

Person {PersonID}
Analyst {AnalystID, PersonID}
WorkAgreement{WorkAgreementID, CompanyID}
Company{CompanyID}
AnalystWorkAgreement{WorkAgreementID, PersonID}

So far I have mapped Person, Analyst, WorkAgreement and Company. But I
can't figure out how to map AnalystWorkAgreement.

here's the mapping for Person and Analyst (note that Analyst is a
subclass of Person) :

<class name="Comp.Person, Comp" table="Person">

  <id name="Id" column="PersonID">
    <generator class="identity"/>
  </id>

  <!-- Description of an analyst entity -->
  <joined-subclass  name="Comp.Analyst, Comp" table="Analyst"
lazy="true">
    <key column="PersonID"/>

  </joined-subclass>

  </class>

The mapping for WorkAggreement :

 <class name="Comp.WorkAgreement, Comp" table="WorkAgreement"
lazy="true">
    <id name="Id" column="WorkAgreementID">
      <generator class="native"/>
    </id>

    <many-to-one name="theCompany" class="Comp.Company, Comp"
column="CompanyID"/>
  </class>

I have not included the mapping for Company as it's quite obvious.

Now I should I map AnalystWorkAgreement? It's meant to be a collection
of WorkAgreements in the Analyst class so I guess somehow the table
should be mapped as a many-to-many property maybe ? I don't think I
should create class for it but ideas are welcomed.

Thanks

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