Re: MyBatis Dynamic SQL Problems.

30 views
Skip to first unread message

srekar

unread,
Oct 16, 2012, 9:22:03 AM10/16/12
to mybati...@googlegroups.com
I think, problem is coming from the CDATA tags that I was using in the
select. I removed those and seems it is working fine.



--
View this message in context: http://mybatis-user.963551.n3.nabble.com/MyBatis-Dynamic-SQL-Problems-tp4025859p4025860.html
Sent from the mybatis-user mailing list archive at Nabble.com.

srekar

unread,
Oct 16, 2012, 9:16:08 AM10/16/12
to mybati...@googlegroups.com
I am using Spring MyBatis 1.1.0.

I am tryrin to use dynamic sql without much sucuss.

SQL mapping,.

<select id="getResultTypes" parameterType="java.util.Map"
resultType="CodedAcrfTestResult">

SELECT
ACRF_RESULT_CODE acrfResultCode, ACRF_RESULT_DESC acrfResultDesc
FROM
CODED_ACRF_TEST_RESULT
<if test="whereCondition=='yes'">
WHERE
PARENT_TEST_TYPE=#{parentTestType} AND ACRF_TEST_CODE=#{acrfTestCode}
</if>


</select>

Here is muy Map that is being passed,

Map pMap = new HashMap();
pMap.put("testType", "01");
pMap.put("testCode", "A1");
pMap.put("whereCondition", "yes");

I get the error saying,
SQL command not properly ended;


Any idea where I am making mistakes?
Can anybody please help me?




--
View this message in context: http://mybatis-user.963551.n3.nabble.com/MyBatis-Dynamic-SQL-Problems-tp4025859.html
Reply all
Reply to author
Forward
0 new messages