You can use this clause with any statement in a Type or Relationship description in the mapping file. Whenever possible, you should use the This example shows two table definitions: table EMP { EMPNO int primary; ENAME string; JOB string;} table HIRE { EMPNO int primary; HIREDATE date; } You can use the type Employee { id EMP(EMPNO); name EMP(ENAME); attribute "Hire Date" HIRE(HIREDATE) using HIRE(EMPNO); } Otherwise, you could use joins. To create an object type out of the data in both tables, you could create a joined table and then refer to the joined table in a Type description as follows: table EMPHIRE { join EMP,HIRE; where EMP.EMPNO=HIRE.EMPNO; } type Employee { id EMPHIRE(EMP.EMPNO); name EMP(ENAME); attribute "Hire Date" HIRE.HIREDATE; } |