ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Rouillier <guyr-...@burntmail.com>
Subject Not identifying missing parameter names
Date Wed, 21 Oct 2009 05:47:18 GMT
I'm using the new multiple parameter capability in the latest version 3 
beta.  I have a method like this in my mapper Java class:

List<Contact> selectContactType(@Param("aCustId") String aCustId, 
@Param("eContactType") Contact.ContactTypeEnum eContactType);


These parameters are used in the WHERE clause.  Here is the text from 
the XML file:

where
    cust_id = #{aCustId, javaType=String, jdbcType=VARCHAR}
    and contact_tp_id = #{eContactType.intValue, javaType=int, 
jdbcType=VARCHAR}

When I first created this, I had a typo in the XML:

   cust_id = #{cust_id}

My application simply reported no data; no errors were logged anywhere.

Since I'm using named parameters in a Java map, shouldn't iBatis be able 
to tell that the #{cust_id} value I had specified in the SQL was not in 
the map?  It then could have logged an error, which would have greatly 
assisted in identifying why my app wasn't showing any data.

Thanks.

-- 
Guy Rouillier

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message