Hi,
I have two tables for which I would like to run one select query by
joining them thru primary keys but would like to use two separate Value
Objects to store them. That requires to have more than one 'resultMap'
attribute in <select> tag. Is it possible? I am using iBATIS 2.3.0.
Here is code from my sqlMap xml:
<typeAlias alias="customerVo"
type="org.nexweb.qol.gcc.model.CustomerVO"/>
<typeAlias alias="customerDependentVo"
type="org.nexweb.qol.gcc.model.CustomerDependentVO"/>
<resultMap id="customerRS" class="customerVo">
<result property="custId" column="CUST_ID"/>
<result property="ssn" column="SSN"/>
<result property="ssnMask" column="SSN_MASK"/>
<result property="firstName" column="FIRST_NAME"/>
<result property="middleName" column="MIDDLE_NAME"/>
<result property="lastName" column="LAST_NAME"/>
<result property="suffix" column="SUFFIX"/>
</resultMap>
<resultMap id="customerDepRS" class="customerDependentVo">
<result property="custId" column="CUST_ID"/>
<result property="depFirstName" column="FIRST_NAME"/>
<result property="depLastName" column="LAST_NAME"/>
<result property="depRelationShip" column="DEP_RELATIONSHIP"/>
</resultMap>
<select id="getListOfCustomers" resultMap="customerRS, customerDepRS"
parameterClass="java.lang.String"> Is this possible?
SELECT
cust_id,
ssn,
ssn_mask,
first_name,
middle_name,
last_name,
suffix,
depFirstName,
depLastName,
depRelationShip,
FROM CUSTOMER cu, DEPENDENT dp
WHERE cu.cust_id = dp.cust_id and ssn_mask = #ssn#;
Thanks
Jasmin
******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.
Thank You!
******************************************************************************