专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016      微信咨询  |  联系我们

java的Generator接口在哪个包中_java

当前位置:网站建设 > 技术支持
资料来源:网络整理       时间:2023/3/5 22:43:54       共计:3631 浏览

java的Generator接口在哪个包中?

首先非常抱歉,我还真不知道,但是我知会创建新的generator接口如下

安装

插件: help->install new sofeware 加入地址

name:generator

location:http://mybatis.googlecode.com/svn/sub-projects/generator/trunk/eclipse/UpdateSite

配置文件

generatorConfig.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> <!-- 驱动程序 --> <classPathEntry location="E:/workspace2/SmartSign20140326/WebContent/WEB-INF/lib/mysql-connector-java-5.1.28-bin.jar" /> <context id="context" targetRuntime="MyBatis3"> <!-- 注释 --> <commentGenerator> <property name="suppressAllComments" value="true" /> <property name="suppressDate" value="true" /> </commentGenerator> <!-- 数据库连接 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/SmartRoad" userId="root" password="root" /> <!--允许数值类型转换成不同类型,否则都映射为BigDecimal --> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- 模型文件 --> <javaModelGenerator targetPackage="cn.tiger.smartsign.entity" targetProject="SmartSign20140326/src"> <property name="enableSubPackages" value="false" /> <!-- 当为true时,产生的代码文件将按照schema产生子文件夹 --> <property name="trimStrings" value="true" /> <!-- set变量时自动剔除空白 --> </javaModelGenerator> <!-- XML映射文件 --> <sqlMapGenerator targetPackage="cn.tiger.smartsign.xml" targetProject="SmartSign20140326/src"> <property name="enableSubPackages" value="false" /> </sqlMapGenerator> <!-- DAO文件(mapper接口) --> <javaClientGenerator targetPackage="cn.tiger.smartsign.dao" targetProject="SmartSign20140326/src" type="XMLMAPPER"> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <!-- 数据库表 --> <table schema="SmartRoad" tableName="users" domainObjectName="Users" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <property name="useActualColumnNames" value="false" /> </table> </context> </generatorConfiguration>

说明:

生成实体类配置

<!-- 模型文件 --> <javaModelGenerator targetPackage="cn.tiger.smartsign.entity" targetProject="SmartSign20140326/src"> <property name="enableSubPackages" value="false" /> <!-- 当为true时,产生的代码文件将按照schema产生子文件夹 --> <property name="trimStrings" value="true" /> <!-- set变量时自动剔除空白 --> </javaModelGenerator>

生成映射器xml文件配置

<!-- 模型文件 --> <javaModelGenerator targetPackage="cn.tiger.smartsign.entity" targetProject="SmartSign20140326/src"> <property name="enableSubPackages" value="false" /> <!-- 当为true时,产生的代码文件将按照schema产生子文件夹 --> <property name="trimStrings" value="true" /> <!-- set变量时自动剔除空白 --> </javaModelGenerator>

生成mapper接口

<!-- XML映射文件 --> <sqlMapGenerator targetPackage="cn.tiger.smartsign.xml" targetProject="SmartSign20140326/src"> <property name="enableSubPackages" value="false" /> </sqlMapGenerator>

数据库表配置

<!-- 数据库表 --> <table schema="SmartRoad" tableName="users" domainObjectName="Users" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <property name="useActualColumnNames" value="false" /> </table>

设置不生成Example类

enableCountByExample="false"

enableUpdateByExample="false"

enableDeleteByExample="false"

enableSelectByExample="false"

selectByExampleQueryId="false"

基本就这样,我只会这些了谢谢

版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
·上一条:有没有耐玩且配置要求不高的单机游戏推荐_java | ·下一条:java中怎么判断long是否为_java

Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有    粤ICP备16019765号 

广州京杭网络科技有限公司 版权所有