Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: uot;parentId"> <result property="parentId" column="parentId"/> <result property="parentName" column="parentName"/> <result property="childList" resultMap="Family.childResult"/> </resultMap> <resultMap id="childResult" class="Child"> <result property="childId" column="childId"/> <result property="childName" column="childName"/> <result property="childAge" column="childAge" nullValue="0"/> </resultMap> <select id="getParent" resultMap="parentResult" parameterClass="int"> SELECT parent.parentId, parent.parentName, child.childId, child.childName, child.childAge FROM parent LEFT JOIN child ON parent.parentId = child.parentId WHERE parent.parentId = #value# </select> </sqlMap> -- [Test] Executing statement "getParent" with parameter '1'. [Expected result] Query returns 1 'Parent' object and 'childList' property of it is empty (doesn't mean null). [Actual result] The 'childList' property of the returned 'Parent' contains 1 'Child' object. [Additional information] If 'nullValue' is not specified in 'childResult', it works as expected. But this, of course, causes an error if there is a row in the 'child' table and the 'childAge' column is null. 'i' character in property names, with Turkish locale You can not use 'i' character in sqlmap files for the name of any property if locale is Turkish. Reproducing is easy, say Locale.setDefault(new Locale("tr")) in application initilization code and look at the values of properties containing 'i' character. The problem is about mapping the parameters to bean methods, not about retrieving bean methods. Patch is easy, in com/ibatis/sqlmap/engine/mapping/result/AutoResultMap change following line: propertyMap.put(propertyNames[i].toUpperCase(), propertyNames[i]);...
View Full Document

This document was uploaded on 10/12/2012.

Ask a homework question - tutors are online