Java Mailing List Archive

http://www.java2.5341.com/

Home » user-java.ibatis »

Advanced Result Mapping documentation error or misunderstanding of
 concept

alebu

2010-05-19

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi, at this moment I am reading documentation "Advanced Result Mapping" section and one think I can't understand in the example with blogs (further reading didn't clarified it either).

SQL Query is described like:

<select id="selectBlogDetails" parameterType="int" resultMap="
detailedBlogResultMap">
select
B.id as blog_id,
B.title as blog_title,
...
</select>

Result set mapping for that query described like:
<resultMap id="detailedBlogResultMap" type="Blog">
<constructor>
<idArg column="id" javaType="int"/>
</constructor>
<result property="title" column="blog_title"/>
...
</resultMap>

As I understand, the alias for block ID is blog_id but constructor's idArg references to column as id. For all other parts of query aliases are correct (from my POV), so is it a problem with documentation (in this case it is repeated in further examples too), or I didn't understand something.
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.