Ibatishelper source code is released. Download it as needed.

Source: Internet
Author: User

I don't know what ibatishelper is. Please refer to here for details.

Http://www.cnblogs.com/suyuan/archive/2008/12/26/1362745.html

Since the release of ibatishelper, many of my friends have sent me emails.Source codeIn the past, I used to send emails to people who needed them. However, as the number of emails received increases, it is very troublesome to distribute them one by one!

Simply publish it here. Download it by yourself!

What you think is your ownCodeIt is very blunt. If any friend has the energy to improve this function, he will make persistent efforts. At present, this can meet our needs and will not be too easy to do. if you have improved it, please give me a piece of code.

If you don't talk nonsense, just provide it.

/Files/Suyuan/ibatishelper_src.rar

If it is helpful to you, please feel free to take advantage of your personal experience ~~~~~~~

Add a relatively complete sqlmap template. Currently, we use this template to generate the template. Modify the template for specific applications.

<? XML version = "1.0" encoding = "UTF-8" ?>

<!Doctype sqlmap
Public "-// ibatis.apache.org//dtd SQL map 2.0 // en"
Http://java.plugbase.org/dtd/sql-map-2.dtd">

< Sqlmap Namespace = "$ {Table }" >
< Typealias Alias = "$ {Table }" Type = "$ {Package}. $ {table }" />
< Typealias Alias = "Sqlpager" Type = "Org. plugbase. SQL. sqlpager" />
< Resultmap ID = "$ {Table} resultmap" Class = "$ {Table }" >
# Foreach ($ item in $ List)
< Result Property = "$ {Item. Name. tolower ()}" Column = "$ {Item. Name. tolower ()}" />
# End
</ Resultmap >

<SelectID= "Count $ {table }"Resultclass= "Int">
Select count (*) from $ {table}
</Select>

<SelectID= "Select $ {table} byid"Parameterclass= "Int"Resultmap= "$ {Table} resultmap">
Select * from $ {table} Where id = # value #
</Select>

< Insert ID = "Insert $ {table }" Parameterclass = "$ {Table }" >
Insert into $ {table}
(
# Foreach ($ item in $ List)
# If ($ {item. Name. tolower ()}! = "ID ")
# If ($ velocitycount = $ list. Count ())
$ {Item. Name. tolower ()}
# Else
$ {Item. Name. tolower ()},
# End
# End
# End
)
Values
(
# Foreach ($ item in $ List)
# If ($ {item. Name. tolower ()}! = "ID ")
# If ($ velocitycount = $ list. Count ())
# $ {Item. Name. tolower ()}#
# Else
#$ {Item. Name. tolower ()}#,
# End
# End
# End
)
</ Insert >

< Update ID = "Update $ {table }" Parameterclass = "$ {Table }" >
Update $ {table}
# Foreach ($ item in $ List)
# If ($ velocitycount = 1)
Set
# End
# If ($ {item. Name. tolower ()}! = "ID ")
# If ($ velocitycount = $ list. Count ())
$ {Item. Name. tolower () }=#{ {item. Name. tolower ()}#
# Else
$ {Item. Name. tolower () }=#$ {item. Name. tolower ()}#,
# End
# End
# End
Where id = # value #
</ Update >

<DeleteID= "Delete $ {table} byid"Parameterclass= "Int">
Delete from $ {table} Where id = # value #
</Delete>

</Sqlmap>

 

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.