Command-line mode using Abator.jar to generate Ibatis-related code and SQL statement XML files

Source: Internet
Author: User

Recently took over an old project, using the database is SQL Server 2008, the framework is SPRINGMVC + spring + ibatis, the old project is to use the Abator plug-in generated by the relevant code, now need to add new features, to be added several new tables, Can currently download the Abator plug-in, in the new version of the Eclippse EE UI is not open, only use the command line to generate the relevant code, the download Abator plug-in extracted, extract the Abator.jar files therein, the other files do not need. The configuration file for Abator is 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= "Net.sourceforge.jtds.jdbc.Driver" connectionurl= "jdbc:jtds:sqlserver://180.1 53.238.121:1433/aazj "userid=" minisns_qwer#$% "password=" fisuhf-owefhoiwe74747 "><classpathentry location=" D :/java_libs/repository/net/sourceforge/jtds/jtds/1.2.4/jtds-1.2.4.jar "/></jdbcconnection>< Javatyperesolver><property name= "Forcebigdecimals" value= "false"/></javatyperesolver>< Javamodelgenerator targetpackage= "Net.minisns.dal.dataobject.model" targetproject= "c:/minisns_new/src/m Ain/java "><property name=" Enablesubpackages "value=" true "/><property name=" Trimstrings "value=" true "/ ></javamodelgenerator><sqlmapgeneratorTargetpackage= "Sqlmap" targetproject= "c:/minisns_new/src/main/resources" ><property name= "enableSubPackages "Value=" true "/></sqlmapgenerator><daogenerator type=" SPRING "targetpackage=" Net.minisns.dal.dao.model "targetproject=" C:/minisns_new/src/main/java "><property name=" Enablesubpackages "value=" true "/></daogenerator><table tablename=" model_entry "><property name=" Useactualcolumnnames "value=" false "/><generatedkey column=" id "sqlstatement=" SQL Server "identity=" true "/> </table><table tablename= "Model_recruiting_program" ><property name= "UseActualColumnNames" value= " False "/><generatedkey column=" id "sqlstatement=" SQL Server "identity=" true "/></table><table Tablename= "Model_choise" ><property name= "Useactualcolumnnames" value= "true"/><generatedkey column= "id "sqlstatement=" SQL Server "identity=" true "/></table> <!---.....--></abatorconText></abatorconfiguration> 

In the above configuration, <property name= "Useactualcolumnnames" value= "false"/> The item is more important, if set to true, then the generated Java class properties and database are consistent, For example, if the database field is underlined, the attributes in the Java class are underlined, so we generally say that the item is set to False, so that the generated code conforms to our specification in Java.

The following is a generated command-line invocation:

The generated code is as follows:

Entity class:

DAO interfaces and implementation classes:

SQL file:

Abator.jar Package used: http://pan.baidu.com/s/1sjnvHHb

Command-line mode using Abator.jar to generate Ibatis-related code and SQL statement XML files

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.