Eclipse plug-in abatorforeclipse1.1.0.zip developed by ibatis

Source: Internet
Author: User

1. Install the plug-in
Download eclipse plugin from http://ibatis.apache.org/abator.html. There are two plugin installation methods.
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.
Bytes
Eclipse-> help> Software Updates> Find and install-> search for new features to install (Press "Next")->
New local site-> select the file you just downloaded-> OK
2. Create a project
Create an Eclipse project, enter the name, select File> New> abator for ibatis configuration file, select location, and type file name: abatorcsonfig. xml.

Click "finish". eclipse will create the abatorcsonfig. xml file under the root directory of the program and open and edit it. The content is as follows:

<? Xml version = "1.0" encoding = "UTF-8"?>
<! DOCTYPE abatorConfiguration PUBLIC "-// Apache Software Foundation // DTD Abator for iBATIS Configuration 1.0 //" http://ibatis.apache.org/dtd/abator-config_1_0.dtd ">
<AbatorConfiguration>
<AbatorContext>
<JdbcConnection driverClass = "driver" connectionURL = "Database URL" userId = "username" password = "password">
<ClassPathEntry location = "database driver jar package"/>
</JdbcConnection>
<JavaModelGenerator targetPackage = "model layer package name" targetProject = "project name"/>
<SqlMapGenerator targetPackage = "map layer package name" targetProject = "project name"/>
<DaoGenerator targetPackage = "dao layer package name" targetProject = "project name" type = "IBATIS"/>
<Table schema = "Mode name" tablename = "table name" catalog = "Database Name"> be sure to write it down. Otherwise, an error will be reported.

</Table>
</Abatorcontext>
</Abatorconfiguration>

Right-click abatorcsonfig. xml and select generate ibatis artifact. The model, map, and Dao directories are generated under the src directory, and the files are created.
Javamodelgenerator: valueobject
Sqlmapgenerator: XML file
Daogenerator: code for placing interfaces and Dao

 

 

 

 

 

 

Write an sqlserver example to show you:

My project name is ibatistest

 

<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype abatorconfiguration public "-// Apache Software Foundation // DTD abator for ibatis configuration 1.0 //" http://ibatis.apache.org/dtd/abator-config_1_0.dtd ">
<Abatorconfiguration>
<Abatorcontext>
<Jdbcconnection driverclass = "com. microsoft. JDBC. sqlserver. sqlserverdriver "connectionurl =" JDBC: sqlserver: // localhost: 1433; databasename = sunlight "userid =" sa "Password =" ">
<Classpathentry location = "E:/ibatistest/lib/MSSQLServer. Jar"/>
<Classpathentry location = "E:/ibatistest/lib/msutil. Jar"/>
<Classpathentry location = "E:/ibatistest/lib/msbase. Jar"/>
</Jdbcconnection>
<JavaModelGenerator targetPackage = "com. accp. model" targetProject = "IbatisTest"/>
<SqlMapGenerator targetPackage = "com. accp. maps" targetProject = "IbatisTest"/>
<DaoGenerator targetPackage = "com. accp. dao" targetProject = "IbatisTest" type = "IBATIS"/>
<Table tableName = "stu" schema = "dbo" catalog = "sunlight">
</Table>
</AbatorContext>
</AbatorConfiguration>

 

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.