Eclipse (myeclipse) generates Ibatis code and configuration files

Source: Internet
Author: User

I. Installing Plug-ins
Download Eclipse Plugin from http://ibatis.apache.org/abator.html. There are 2 ways to install a plugin.
1. Remote Installation.
Eclipse->help>software Updates>find and Install->search for new features to Install->
New Remote site (name:abator for Eclipse Update site, url:http://ibatis.apache.org/tools/abator)
->ok->abator for Eclipse Update Site->ok
2. Manual Installation.
http://ibatis.apache.org/abator.html download Abatorforeclipse1.1.0.zip, download and operate in eclipse
Eclipse->help>software Updates>find and Install->search for new features to Install (press "Next")->
New local site-> selection just download the file->ok
Two. Establishment of a project
Create a new Eclipse project, enter a name, then select File > New >abator for iBatis configuration file, select location, and type file Name:abatorCsonfig.xml.

Click "Finish" and Eclipse will create the Abatorcsonfig.xml file in the root directory of the program and edit it to read as follows:

<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE abatorconfiguration Public "-//apache Software foundation//dtd abator for IBATIS Configuration 1.0//en" "http://i Batis.apache.org/dtd/abator-config_1_0.dtd ">
<abatorconfiguration >
<abatorcontext >
<jdbcconnection driverclass= "Driver" connectionurl= "Database url" userid= "username" password= "password" >
<classpathentry location= "Database-driven Jar pack"/>
</jdbcConnection>
<javamodelgenerator targetpackage= "model Layer package path" targetproject= "src path"/>
<sqlmapgenerator targetpackage= "Map Layer package path" targetproject= "src path"/>
<daogenerator targetpackage= "DAO Layer Package path" targetproject= "src path" type= "IBATIS"/>
<table schema= "table name" tablename= "table name" catalog= "database name" > must be written, or it will be an error.

</table>
</abatorContext>
</abatorConfiguration>

Click on the Abatorcsonfig.xml right mouse button, select Generate IBATIS artifact, in the SRC directory will generate model, map, DAO three directories, the file is also established.
Javamodelgenerator: We used to say Valueobject
Sqlmapgenerator:xml file
Daogenerator: Code to place Interfaces and DAO

Related Article

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.