Sorry, that is supposed to be "inner join on separate data bases".
D'oh.


Charlie



Charles N. Harvey III wrote:


Hello.
I was wondering if it was possible to join two objects that are
mapped to two separate DBs.

SELECT p.name, p.email, e.title, e.position
FROM users.dbo.PERSON AS p
INNER JOIN office.dbo.EMPLOYEES AS e ON e.employee_id = p.person_id
WHERE e.title = 'Manager'

<class-descriptor
 class="com.mycom.users.om.Person"
 table="PERSON">
 <field-descriptor
   name="id"
   column="person_id"
   jdbc-type="INTEGER"
   primarykey="true"
   access="readwrite"/>
 <field-descriptor
   name="name"
   column="name"
   jdbc-type="VARCHAR"
   access="readwrite"/>
 <field-descriptor
   name="email"
   column="email"
   jdbc-type="VARCHAR"
   access="readwrite"/>
 <field-descriptor
   name="employeeId"
   column="employee_id"
   jdbc-type="INTEGER"
   access="anonymous"/>
 <reference-descriptor
   name="employee"
   class-ref="com.mycom.office.om.Employee">
   <foreignkey
     field-ref="employeeId"/>
 </reference-descriptor>
</class-descriptor>
<class-descriptor
 class="com.mycom.office.om.Employee"
 table="EMPLOYEE">
 <field-descriptor
   name="id"
   column="employee_id"
   jdbc-type="INTEGER"
   primarykey="true"
   access="readwrite"/>
 <field-descriptor
   name="title"
   column="title"
   jdbc-type="VARCHAR"
   access="readwrite"/>
 <field-descriptor
   name="position"
   column="position"
   jdbc-type="INTEGER"
   access="readwrite"/>
</class-descriptor>

I have two connection descriptors in my repository.xml.  Should I
change the table="EMPLOYEE" with table="office.dbo.EMPLOYEE"?

Can this be done.  There is a very good chance that my mappings
are not done correctly.

Any help is much appreciated.


Charlie



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to