ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radha rukmani <radharukm...@yahoo.com>
Subject sql joins in ibatis
Date Wed, 04 Jan 2006 22:44:57 GMT
Hi 
I am new to iBATIS. I was able to run the person example in the ibatis website. 
For one table, the example says,
<select id="getPerson" resultClass="com.comp.app.batchProcess.Person">
          SELECT 
               PER_ID as id,
               PER_FIRST_NAME as firstName,
               PER_LAST_NAME as lastName,
               PER_BIRTH_DATE as birthDate,
               PER_WEIGHT_KG as weightInKilograms,
               PER_HEIGHT_M as heightInMeters
          FROM PERSON
          WHERE PER_ID=#value#
     </select>
but if i want details from two tables, say person and dept table. I have two bean classes
person.java and dept.java
and if i want to select like,
select per_id as id, per_first_name as firstname, dept_name as deptname from person,dept where
dept_no = 2
now  resultClass="com.comp.app.batchProcess.Person" and  "com.comp.app.batchProcess.Dept"
how to get around this. Any help is greatly appreciated.
Thanks
   

		
---------------------------------
 Yahoo! DSL Something to write home about. Just $16.99/mo. or less
Mime
View raw message