我们使用mybatis的逆向工程来生成pojo类,省去很多不必要的工作。
我把逆向工程需要的项目如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASMAAAEyCAIAAAA+yCFEAAAgAElEQVR4nO2dX3AUx53H9eJ3HlKV+OHKjuMkGFdMjG0SKw7m5Qy5pAonV1ThKudM/GfPhNgGLo6AiCBki5PBPq9BYJwYIWwLi78h+LyGGErGLv74jsvJNsQ6KzaSBbEQiGwkkGa1gr6H2Z3pnv71/Nk/vbMz309NUdrRdG/PMp/tntH0d2oYACA46YDUVLrBBJMf3FjpJgDgAUwDQAfVYdoHu5dZi/zb+JmWStQkUpVuBAhEFZjWtWuZ+HKpY4OomJZK1OTw0qisptnNgM4lRKtpV69e9VxjsWHVMxtWPbNhVfP4udbxc62jpzde+GBt/+EV/7dv8YZVzYyxOb/Zbm4ZPtN6krVBj9JUwj6we5K17qXLZloqIfiVStQme3wXLmCvYwSp0/z580tv2pYtW+rq6rLZrLUmm83W1dW1tbWR2z/z6+eaXjjO/v4uvXCCRcG0nmRtgIO6TKbxthcATHOD1MyklKZNTEzU1dXNnDnTks3UzFwzMTFBllqyeD07/wa9MLbz3Y8nP7hx8oMbt/zxA8XbWgOh2mQyUWMfyvYAKb8ulTC3EVaSW5rHUyphrepJ1gqjLW70lSvDrbEPRUc9qqOcL8tXaG6bStTUJlO5BiRS9ub2LjibJ741vz7Ff0QcvEHcz2LFPvfaR4MjikozlWyF92nj4+OWWqOjow7xSB7615fY2deUiweO8Rh/BFj/rdaBww2bepK1uQ3ILc0DjBMmkd/EfkP+2EwlahyO29sIcuWOOV43QT+uIt60GruxNfL7K5tXIzQw/xn4N43owPzstWeDI4uqN1PJVtR5mtWP/ehHP/LUzGTw/S197XMH39/CGJv/cOv8hzebywMPb57/yOYHzJ8f2Tz/4c3Oko7jxnopdhL5/3eHVPl1xJaKQ0z48ua2cR6+boeqXRXXYxG74OjTepy/dpR0ax7/MlifZn46fAE/e+2rwZFENk31sgSmMXHQ6KkZ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PMA0AHcA0AHQA0wDQAUwDQAcwDQAdRNk05IiA8BBl05AjEoQK5YgEDlPQQFnu54qyacgR8U/FckRgWgRMQ45IoDqikm5QPDAtIMgRCVQLTMsD0wKCHJFK5og4Z9+I04KsDYXpcD4/ScU8G2r0HJ4kkiibhhyRSmmbsf4AAAILSURBVOaIkKbJ/Z/4dr4+SbdK6A8iDEkkUTYNOSKVzBGh+zQpR8TRp/n6JKVKiDWOz4L/bWXmkkbZNOSIVDpHRDHdnM8R8TRNOTbmKlGusZoO08oJckQqmSPCDU3dckTcTVOkjMiVUNUKu1bxJJIom4YckYrmiNil3XJEPEyjr3VIl1/IanNnZyFJIomyacgRKSX4HIojyqYhR6Q48DmUkiibhhyRYsHnUDqibBoA4QGmAaADmAaADmAaADqAaQDoAKYBoIMom4YcERAeomwackSCUHCOSCDKcqNTVRBl05Aj4p8ickQCAdOiaBpyRALVoeUuEJgWRdOQIxKoFphWVqJsGnJEypojEp6IjqogyqYhR6TcOSIhieioCqJsGnJEypMj4ngbvi+vzCTLqiDKpiFHpPw5IjDNL1E2DTkiZckRCV9ER1UQZdOQI1KWHJHwRXRUBVE2DTkipQSfQ3FE2TTkiBQHPodSEmXTkCNSLPgcSkeUTQMgPMA0AHQA0wDQAUwDQAcwDQAdwDQAdKDJtCMf9k/52Ys/Wbm9tK0HoFrQZNq7H/V/48GN/9yg+mMxABFHk2nvfdT/jQc3/bhB/cfiGMFNr7TvGhSQngrG3yvoLA6qgkJMu3r1qqMWeY2Dd0/2TvnZi/c2vm6+/O+1t5hLOXYp3Ig3vsu32wozaBwzmn0UB2ElqGn/D+1Sd4OGCy5yAAAAAElFTkSuQmCC" alt="" />
GeneratorSqlmap.java是项目的主入口。
GeneratorSqlmap.java代码如下:
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List; import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.exception.XMLParserException;
import org.mybatis.generator.internal.DefaultShellCallback; public class GeneratorSqlmap { public void generator() throws Exception{ List<String> warnings = new ArrayList<String>();
boolean overwrite = true;
File configFile = new File("generatorConfig.xml");
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfiguration(configFile);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,
callback, warnings);
myBatisGenerator.generate(null); }
public static void main(String[] args) throws Exception {
try {
GeneratorSqlmap generatorSqlmap = new GeneratorSqlmap();
generatorSqlmap.generator();
} catch (Exception e) {
e.printStackTrace();
} } }
这里的aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAABKCAIAAADMho1GAAAGn0lEQVR4nO2bTU/jRhjH8zV66K1ShXpA6jGfgHO/QG9Wq/SU0x5WavewEa22i7WwNGy3LKJLli6EItS1VKmrXHtEiEpoc1hAVJTwooiXZPLqHpw4Y/sZY+MYP1n+P1mrZJiZ2JP52eOs/ykzPM1mc3V1tVAobG9v+1T749vPxe6CvRWz4z6bp7WhpTTDNM2ynrZeSK9M4i0A11MNSSrsB3Q6nVKpVCgUSqVSp9PxqVnMfiZ2dGsrZsfFbp7c/tuchB7gdohXj+BumKa59M0nYmdS7EwWs+PWC++mcMNU6WEL4XgDQDBi1KPb7QZ3wzTN+S8/Fpv3itlxsfkduandMJVXD01L9YAbIDTxXj22trYCumGa5tQXHxWz42LzHrn5ugFALMSrh2ma3W43eOV57VOfLexHAxCR2PUAYHSBHgAogR4AKIEeACiBHgAogR4AKIEeAChhp0fJmCS3uD8XAC/s9PjrzQ+NZtu1bW98DUMoyno6lUqlNF1Pp9J6OVxDTo/Z9J8JYgY7Pf7ceOTV493b+/98gIYY9gNhN5sbzufLoMfwYafHm/Up0WhbW73REo12vdHe/Xvq3dv72xtfGeuP496B8NxoqhmaQwpDCzW77T5u0Mo0TegREHZ6rBefXInWlWiNTWQyD+au6u3Mg7mxicyVaNdEe2PtSdw7EJ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DWp2dHsiaJ5k1p68enqy56+oRaCQ9nRAlrrGQ/5pMoIqdHsiaJ501VwQl5az5tXool45SJ8oSe9ehhwdkzZPMmksrN7+sub8eiiS6txOqW8ehJZ5WZ6cHsuaJZs0Hrf2y5tfoQd90e34HILvt3XEwSauz0wNZ82GCcYgGOz2QNY8GxmGYsNMDWfOoYByGBzs9AOAD9ABACfQAQAn0AEAJ9ABACfQAQAk7PZA1B3xgpwey5mG4cdY8FLE8rzESsNMDWfPgRMiahwJ6sNEDWfNQfdzK/4tDDzZ6IGseqhfoESvs9EDWPNasOZ8Y90jATg9kzePOmjOJcY8E7PRA1jyerLnrY+SrZjJJo5GAnR7ImsefNYceQWGnB7LmsWTN+cW4RwJ2eiBrHkvWnF+MeyRgpwey5sME4xANdnogax4NjMMwYacHsuZRwTgMD3Z6AMAH6AGAEugBgBLoAYAS6AGAEugBgBLoAYCSsHr8DypJvEm4bAYcAAAAAElFTkSuQmCC" alt="" />使我们要生成的pojo类的。
拿其中一个generatorConfig.xml来说。
genertorConfig.xml代码如下:
<?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>
<context id="testTables" targetRuntime="MyBatis3">
<commentGenerator>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
<!-- <jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/mybatis" userId="root"
password="mysql">
</jdbcConnection> -->
<jdbcConnection driverClass="oracle.jdbc.OracleDriver"
connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:MYORCL"
userId="shen"
password="1234">
</jdbcConnection> <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver> <!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="yycg.base.pojo.po"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProject:mapper映射文件生成的位置 -->
<sqlMapGenerator targetPackage="yycg.base.dao.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- targetPackage:mapper接口生成的位置 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="yycg.base.dao.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- 指定数据库表 -->
<table schema="shen" tableName="sysuser"></table> <!-- 有些表的字段需要指定java类型
<table schema="" tableName="">
<columnOverride column="" javaType="" />
</table> -->
</context>
</generatorConfiguration>
然后运行GeneratorSqlmap 代码后 ,在工程点击右键Refresh键,就会在相应的包下面生成pojo类和xml文件了。
运行结果如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR0AAAG+CAIAAAAhgEdsAAAgAElEQVR4nO2d7Y8cR53H97/gpZUgJCsRiDyRYwiW/4BIQSet5Ei8sEAa8aAo67uEJcQn5zYPPB3H6HwKvMjZa4T3yGGBFHRjUIiWIAWTF4eEMZcoq0u8OA7etZdsvPHu7MzadS+mpuvpVz3dNdU9XVXfj1Zhp7erp8b0Z7q6u37fnmEAJM9mScwt/PLc5UsX3/jru29tXru4ee3iTP2fAYCmAa8A8A+80jnywEcm3US3PdPqrOStsdJpzczMzLS7pTZaZvXSrHRa1b5BUsArtrxw16vf+Hj2c3x2n/xyeeGunLb0zjjOK6ddOEivxn/DREpUXt26dWvsEpNX5+9cWT5x+f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fwjYONN4uJ/TC+ru2cbk3WcWz+RGM1fPfPbTIDXgliDffophXdJqFD69yzh4jjdyAV5yY8y0sO2C2y4phHpFmUcgr9V3NcaDxEWKP3IBXjEWfb6Hfv+JnVcpf211LmkWx41Xb7Ld03cL8CLFHbsArThL5Fg18+waP5SYBXgmiz7eo7v2dzZh256sCXrkTUr5Fhbh61YjOVwW8AsA/8AoA/8ArAPwDrwDwD7wCwD/wCgD/wCt3kG8BbMArd5qSb1GKWG/ENgx4JQg136IU8KoW4BUnwnwLMD3gFWOx5luA6QGvOMHmW7Tb8sCu26aWSO8WaZ5E04BXglDzLaRVeM2TuUR+rxjzJJoGvFIIMt9CbNCMajHCxiLNk2ga8EoQar7FSExtiKcnoGlN48qTaBrwihNwvgUzQiDMJbHnSTQNeMVY6PkWWUP1yKYsiT1PomnAK07A+RaMMWrAWGwICSoBXgkCzbdgjLLF4g+mW9QDvHJn+vkWjDE13dm2RCzFwaoW4BUA/oFXAPgHXgHgH3gFgH/gFQD+gVcA+AdeuYN8C2ADXrkTZL5FrRR7dHeM96rhlSDqfAvtEVj13B2GV8l7FXu+xVTmBRbzKka8e/X/DaYi3nT0/IAAAAAASUVORK5CYII=" alt="" />
现在讲最重要的一个问题,就是我们在生成xml文件时,随便拿一个举例,BasicinfoMapper.xml为例,
在这个xml文件中生成了两个<resultMap id="BaseResultMap" type="yycg.base.pojo.po.Basicinfo" >。
很明显这样是不对的,运行直接报错,那怎么办。
解决办法,
1:在这个文件generatorConfig.xml,generatorConfig-business.xml;generatorCOnfig.xml;这三个文件中
碰到<table schema="" 。就改为<table schema="shen" ,这个shen是数据库的一个用户。
然后再把之前自动生成的pojo类和xml文件全部删除,重新生成一遍。
2:然后在去找到所有生成的xml文件,比如BasinfoMapper.xml文件,把里面的
SHEN.这几个字全部替换为空,用ctrl+F的方式替换掉。
这样就好了。
上述解决办法的来源:
Table schema问题
Schma即数据库模式,oracle中一个用户对应一个schema,可以理解为用户就是schema。
当Oralce数据库存在多个schema可以访问相同的表名时,使用mybatis生成该表的mapper.xml将会出现mapper.xml内容重复的问题,结果导致mybatis解析错误。
解决方法:在table中填写schema,如下:
<table schema="XXXX" tableName=" " >
XXXX即为一个schema的名称,生成后将mapper.xml的schema前缀批量去掉,如果不去掉当oracle用户变更了sql语句将查询失败。
快捷操作方式:mapper.xml文件中批量替换:“from XXXX.”为空