Generator automatic generation of MyBatis configuration and class information
I use the command at the time of the test. The following error occurred
C:\users\xa>java-jar E:\mybatis-generator-core-1.3.1.jar-configfile D:\Workspaces\MyEclipse10\risenetba\src\ Generator.xml-overwrite
Table configuration with catalog null, schema Orclba, and table Zwdt_zidian didn't resolve to any tables
MyBatis Generator finshed successfully, there were warninigs.
The following is a Generator.xml file
<?xml version= "1.0" encoding= "UTF-8"?> <! DOCTYPE generatorconfiguration Public "-//mybatis.org//dtd mybatis Generator Configuration 1.0//en" "Http://mybatis. Org/dtd/mybatis-generator-config_1_0.dtd "> <generatorConfiguration> <!--classpathentry: Database JDBC-driven jar package address--<classpathentry location= "D:\Workspaces\MyEclipse10\risenetba\defaultroot\WEB-INF\lib \ojdbc14.jar "/> <context id=" db2tables "targetruntime=" MyBatis3 "> <commentGenerator> <!--removal of automatic Note true: Yes: false: No--<property name= "suppressallcomments" value= "true"/> <!--database connection information: Driver class, connection address, user name , password--</commentGenerator> <jdbcconnection driverclass= "Oracle.jdbc.driver.OracleDriver" Connectionurl = "Jdbc:oracle:thin: @xx. Xx.x.xxx:1521:xx" userid= "xx" password= "1" > </jdbcConnection> <!--default false, the JDBC The decimal and NUMERIC types resolve to Integer true to resolve the JDBC decimal and NUMERIC types to Java.math.BigDecimal and <javatyperesolver> <property name= "forcebigdecimals" value= "false"/> </javaTypeResolver> <!--targetproject: Auto Generation generation Code Location--<javamodelgenerator targetpackage= "Xgw.model" targetproject= "D:\Workspaces\MyEclipse10\risenetba\
src "> <!--enablesubpackages: Do you want the schema to be the suffix of the package--<property name=" Enablesubpackages "value=" false "/>
<!--the value returned from the database is cleared before and after the space-<property name= "Trimstrings" value= "true"/> </javaModelGenerator> <sqlmapgenerator targetpackage= "Xgw.sqlmap" targetproject= "D:\WORKSPACES\MYECLIPSE10\RISENETBA\SRC" > < Property Name= "Enablesubpackages" value= "false"/> </sqlMapGenerator> <javaclientgenerator type= "Xmlmapp ER "targetpackage=" xgw.mapping "targetproject=" D:\Workspaces\MyEclipse10\risenetba\src "> <property name=" Enablesubpackages "value=" false "/> </javaClientGenerator> <!--tableName: database table for automatic code generation ; Domainobjectname: JavaBean class name corresponding to database table---<table SchEma= "xx" tablename= "Zwdt_zidian" domainobjectname= "Zidian" enablecountbyexample= "true" enableupdatebyexample= "true "Enabledeletebyexample=" true "enableselectbyexample=" true "selectbyexamplequeryid=" true "> </table> </ Context> </generatorConfiguration>
Later, it is possible to remove the schema attribute from table.
After testing, if the database uses Oracle,sqlserver need to remove the schema attribute, MySQL does not need to remove