Hi,

as I need a similar example as on
http://castor.exolab.org/castor-one.html#Different-cardinalities-of-relationship


(my example would be that a customer could also belong to more then 1
department),  I read this faq, but I don't understand it quiet well :(.

The Employee table has "id", "name" and "salary". There's is a mapping
for "id" and "salary", but for "name" there seems only to be:

<field>
  <sql many-table="employee_department" many-key="e_id" name="d_id"/>
</field>

Could this be a mistake, I mean, the mapping for "name" is probably left out? I also can't figure out how Castor knows where to get "d_id"?

If this example would be completed, how could it look like? For the object model, could it be:
Employee{
get/setID();
get/setName();
get/SetSalary();
joinDepartment(); //-> for my example, an employee can...
leaveDepartment(); // ...belong to more then 1 department
getDepartments();
}


Department {
  get/setID();
  get/setName();
  get/setComment();
  addEmployee();
  removeEmployee();
  getEmployees();
}

But then I get stuck with providing a correct mapping, I'm hoping sb. could help me with this one. The bidirectional mapping went smooth, but this one is a bit more difficult :(.

greetings,
Mattias Campe

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to