ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Siler" <luke.si...@lsbio.com>
Subject Composite Key parameter
Date Mon, 21 Aug 2006 19:36:54 GMT
Hi,

I'm trying to expand a 1:M collection property based on a composite key.
The 1.3 Data Mapper Guide shows a sample of composite key parameter
mapping as follows:


Example 3.44. Mapping a composite key
<resultMaps>
<resultMap id="select-order-result" class="order">
<result property="id" column="ORD_ID"/>
<result property="customerId" column="ORD_CST_ID"/>
...
<result property="payments" column="{itemId=ORD_ID, custId=ORD_CST_ID}"
select="selectOrderPayments"/>
</resultMap>
<resultMaps>
<statements>
<statement id="selectOrderPayments" resultMap="select-payment-result">
select * from PAYMENT
Working with Data Maps
DataMapper Guide Version 1.3.0 40
where PAY_ORD_ID = #itemId#
and PAY_CST_ID = #custId#
</statement>
</statements>
Optionally you can just specify the column names as long as they're in
the same order as the
parameters. For example:
{ORD_ID, ORD_CST_ID}




However, this syntax expressed in the result map below yields the
following error message for me.  Basically, the trailing bracket "}" is
not getting parsed out properly.  If I remove the brackets then I don't
get any error but only one column of the two always seems to win.


Test method
LS.Antibody.Inventory.Persist.Test.AntibodyMakeImplTest.AntibodyMakeDao_
Get_TestMethod threw exception:  System.IndexOutOfRangeException: LSID}.


<result property="Alternatives" column="{AntibodyID, LSID}"
select="ABPOGetAntibodyByLSID"/>



I haven't seen any other activity on the list about this problem so
guessing I must be doing something wrong.  I've tried changing order of
columns, stored procedure parameters, played with aliasing, removing
spaces, etc.  Nothing seems to work.

Is this only supported for inline parameter mapping with <statement>
rather than <procedure>?


Luke Siler
Software Engineer
LifeSpan BioSciences, Inc.
lukes@lsbio.com
206.374.1135 


Mime
View raw message