mybatis逆向工程generatorConfig.xml配置(MySQL和SQL server)
来源:互联网 发布:淘宝交易系统架构 编辑:程序博客网 时间:2024/06/05 19:12
MySQL配置文件
<?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> <properties resource="jdbc.properties"></properties> <classPathEntry location="D:\lion\LionTest\WebContent\WEB-INF\lib\sqljdbc4.jar" /> <context id="context1"> <!--<commentGenerator> <!– 去除自动生成的注释 –> <property name="suppressAllComments" value="true" /> </commentGenerator>--> <!-- 是否生成注释 去除自动生成的注释--> <commentGenerator> <property name="suppressDate" value="true"/> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 数据库连接配置 --> <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://localhost:1433;DatabaseName=tvshow" userId="sa" password="sa" /> <!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制--> <javaTypeResolver> <property name="forceBigDecimals" value="false"/> </javaTypeResolver> <!--配置生成的实体包 targetPackage:生成的实体包位置,默认存放在src目录下 targetProject:目标工程名 --> <javaModelGenerator targetPackage="com.lion.pojo" targetProject="SqlTest" /> <!-- 实体包对应映射文件位置及名称,默认存放在src目录下 --> <sqlMapGenerator targetPackage="com.lion.mapper" targetProject="SqlTest" /> <!--生成Dao类存放位置--> <javaClientGenerator type="XMLMAPPER" targetPackage="com.lion.dao" targetProject="SqlTest"> <property name="enableSubPackages" value="true"/> </javaClientGenerator> <!--生成对应表及类名--> <!-- 配置表 schema:不用填写 tableName: 表名 enableCountByExample、enableSelectByExample、enableDeleteByExample、enableUpdateByExample、selectByExampleQueryId: 去除自动生成的例子 --> <table schema="" tableName="production" domainObjectName="Production" enableCountByExample="false" enableSelectByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" selectByExampleQueryId="false" > </table> </context> </generatorConfiguration>
MS SQL server配置
<?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> <properties resource="jdbc.properties"></properties> <classPathEntry location="D:\lion\LionTest\WebContent\WEB-INF\lib\sqljdbc4.jar" /> <context id="context1"> <!--<commentGenerator> <!– 去除自动生成的注释 –> <property name="suppressAllComments" value="true" /> </commentGenerator>--> <!-- 是否生成注释 去除自动生成的注释--> <commentGenerator> <property name="suppressDate" value="true"/> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 数据库连接配置 --> <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://localhost:1433;DatabaseName=tvshow" userId="sa" password="sa" /> <!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制--> <javaTypeResolver> <property name="forceBigDecimals" value="false"/> </javaTypeResolver> <!--配置生成的实体包 targetPackage:生成的实体包位置,默认存放在src目录下 targetProject:目标工程名 --> <javaModelGenerator targetPackage="com.lion.pojo" targetProject="SqlTest" /> <!-- 实体包对应映射文件位置及名称,默认存放在src目录下 --> <sqlMapGenerator targetPackage="com.lion.mapper" targetProject="SqlTest" /> <!--生成Dao类存放位置--> <javaClientGenerator type="XMLMAPPER" targetPackage="com.lion.dao" targetProject="SqlTest"> <property name="enableSubPackages" value="true"/> </javaClientGenerator> <!--生成对应表及类名--> <!-- 配置表 schema:不用填写 tableName: 表名 enableCountByExample、enableSelectByExample、enableDeleteByExample、enableUpdateByExample、selectByExampleQueryId: 去除自动生成的例子 --> <table schema="" tableName="production" domainObjectName="Production" enableCountByExample="false" enableSelectByExample="false" enableDeleteByExample="false" enableUpdateByExample="false" selectByExampleQueryId="false" > </table> </context> </generatorConfiguration>
阅读全文
1 0
- mybatis逆向工程generatorConfig.xml配置(MySQL和SQL server)
- MyBatis逆向生成-generatorConfig.xml详解
- mybatis 逆向工程mybatis-geneator.xml配置
- Mybatis最入门---代码自动生成(generatorConfig.xml配置)
- Mybatis最入门---代码自动生成(generatorConfig.xml配置)
- Mybatis最入门---代码自动生成(generatorConfig.xml配置)
- Mybatis最入门---代码自动生成(generatorConfig.xml配置)
- Mybatis---代码自动生成(generatorConfig.xml配置)
- Eclipse的MyBatis插件之generatorConfig.xml配置(一)
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- 2017年工作总结
- android TV中AlertDialog设置按键监听方法和禁止按键监听属性
- 全文搜索引擎 Elasticsearch 入门教程
- python爬虫提取数据之Beautifulsoup4简单使用
- C语言实现按分隔符来截取字符串
- mybatis逆向工程generatorConfig.xml配置(MySQL和SQL server)
- 设计模式之详解七种单例模式
- NGUI中UITextList的使用
- XMind,让你的双十二亮起来
- 所有面积公式
- iOS中代理属性为什么要用Weak修饰?
- 【Android学习】Window和WindowManager
- hdoj 6231 K-th Number
- python内置函数lambda、filter、map、reduce