The use and difference of resultclass,parameterclass,resultmap,resulttype in Ibatis

Source: Internet
Author: User

Parameterclass is a parameter class. Specifies the full class name of the parameter, including the package path. You can avoid writing lengthy class names every time by using aliases.

ResultClass is the result class,

Second, ResultClass value

1.resultclass= "Integer"//basic type, or Java.lang.Integer

2.resultclass= "Com.sfbest.product.bean.ProductPicture"//model object

3.resultclass= "string"//basic type, java.lang.String

4.resultclass= "Long"//basic type, Java.lang.long

5.resultclass= "Java.util.HashMap"//map Collection

The usage of ResultClass is as follows:

<select id= "GetCount" parameterclass= "Ordermanualitem" resultclass= "Java.lang.Integer" >
Select COUNT (*) from Order_manual_item OMI
where omi.is_delete= ' N '
</select>

Resultmap is a result mapping, which needs to be defined with the RESULTMAP node for the mapping relationship.

Resulttype returns a value type that does not need to be mapped directly using

<!--prescription drug reminder SQL LYD
<select id= "selectuntcpaidmobilesnew" parametertype= "map" resulttype= "Java.util.HashMap" >
Select M.mobile as mobile,o.order_id as OrderID
From Order_info o,member m
Where o.member_id=m.member_id and m.mobile are not null and O.payment_mode = ' kdfh '
and O.is_paid! = ' Y '
and O.IS_TC = ' Y '
and o.order_state! = (select code_id from Sys_code
where code_type_no = ' order_state '
and Code_no = ' Cancel ')
and o.is_delete = ' N '
and round (To_number (sysdate-to_date (o.commit_time, ' yyyy-mm-dd hh24:mi:ss ') *) &gt;= 12
and round (To_number (sysdate-to_date (o.commit_time, ' yyyy-mm-dd hh24:mi:ss ') *) &lt;36
</select>

The use and difference of resultclass,parameterclass,resultmap,resulttype in Ibatis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.