Greetings, I have a table in my database that has multiple references to a table containing person data. The references are foreign keys to the person table: loan.loan_borrower_id loan.loan_mortgagor_id Both reference person.person_id.
In SQL if I wanted to return a single row that contained information about both the borrower and the mortgagor, I would use the following sql statement: <1> select p1.pers_id, <2> p2.pers_id, <3> loan_id, <4> p1.pers_first_name as borrower_name, <5> p2.pers_first_name as mortgagor_name <6> from loan, person p1, person p2 <7> where loan_borrower_id = 1 and loan_mortgagor_id = 2 <8> and p1.pers_id = loan_borrower_id <9> and p2.pers_id = loan_mortgagor_id; I don't see an easy way to do this using criteria. The Criterion inner class takes a stab at it, but it doesn't seem to be able to do joins across different tables, so it would be inadequate to address the restriction clauses of lines <8> and <9> above. Is there a way to easily do these kinds of joins, and, if not, is there a way to send a sql statement directly to the data layer in the torque framework? Thanks for your help, Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
