Ibatis Code generation tool Abator Use the whole process-(tanlier1)

Source: Internet
Author: User
Tags mssqlserver
For the first contact, in the end how to start the use of abator, less resources, this article recorded the first time I use the process today, I hope that the same beginners to help.

1. Obtain
Http://ibatis.apache.org/abator.html
Eclipse can automate the update acquisition of this plugin, the official installation steps.

If you ' ve already installed a prior version of Abator, simply run the Eclipse install/update tool and the new version would be found automatically.

If you ' ve not already installed Abator, then can use the built in Eclipse install support by following these Steps:ta Ke the "help>software updates>find and Install" menu Option Select the "Search for new features to Install" Radio bu Tton, press "Next" "New Remote Site" button Enter the following information:Name:Abator for Eclipse Update Sit E Url:http://ibatis.apache.org/tools/abator Press OK Check the box next to "Abator for Eclipse Update Site" Follow the RE Mainder of the Install Wizard

2, after the installation will be in the new menu to see a novel file type Abator for IBATIS Configuration file, this is the Abator configuration file, configuration file details see Http://ibatis.apache.org/docs /tools/abator/

3, a new configuration file, to modify, according to their actual needs to modify
Key points:
1) Jdbcconnection, according to the general configuration can be explained that it needs to specify access to the Jdbcdriver classpathentry, for MSSQLServer, to the three jar files are included, Otherwise, there will be a JDBC access error.
2) Configure three Pakage
3 configuration table, which should be described here for MSSQLServer can not write Tableschema, I first specified Tableschema, the results did not find the corresponding table
The simple configuration is as follows, complicated by the detailed description of the configuration file. The sample configuration file is as follows
<abatorConfiguration>
<abatorContext> <!--todo:add Database Connection Information-->
<jdbcconnection driverclass= "Com.microsoft.jdbc.sqlserver.SQLServerDriver"
Connectionurl= "JDBC:MICROSOFT:SQLSERVER://LOCALHOST:1433;DATABASENAME=WHM; Selectmethod=cursor "
userid= "SA"
password= "SA" >
<classpathentry location= "C:/Program files/apache Software foundation/tomcat"/ >
<classpathentry location= "C:/Program files/apache Software foundation/tomcat" 5.0/common/lib/msutil.jar
<classpathentry location= "C:/Program files/apache Software foundation/tomcat" 5.0/common/lib/msbase.jar
</jdbcConnection>

<javamodelgenerator targetpackage= "Com.dwerp.itatis.domain" targetproject= "Bhbmanage"/>
<sqlmapgenerator targetpackage= "Com.dwerp.itatis.persistence.xml" targetproject= "Bhbmanage"/>
<daogenerator type= "IBATIS" targetpackage= "Com.dwerp.itatis.persistence.sqlmapdao" targetproject= "Bhbmanage"/ >

<table tablename= "Bhbgl" >

</table>

</abatorContext>
</abatorConfiguration>

4, right click the configuration file, click Generate IBatis artifacts, generate file.

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.