未验证 提交 0e602317 编写于 作者: M MegaGao 提交者: GitHub

Update README.md

上级 8e9102f1
# 欢迎报bug或pull request ~
若图片不能正常显示,请点击博客地址:[制造装备物联及生产管理系统](http://www.realfond.cn/2016/12/27/%E5%88%B6%E9%80%A0%E8%A3%85%E5%A4%87%E7%89%A9%E8%81%94%E5%8F%8A%E7%94%9F%E4%BA%A7%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/)
若图片不能正常显示,请点击博客地址:[制造装备物联及生产管理系统](http://www.realfond.cn/2016/12/27/%E7%94%9F%E4%BA%A7%E7%AE%A1%E7%90%86ERP%E7%B3%BB%E7%BB%9F/)
# production_ssm
......@@ -203,69 +203,69 @@ KindEditor主要特点
<!-- 在Host标签下添加下面两行,配置虚拟路径到你本机的文件夹 -->
<Context path="/pic" docBase="D:\upload\temp\img" crossContext="true" trusted="true" reloadable="true"/>
<Context path="/file" docBase="D:\upload\temp\file" crossContext="true" trusted="true" reloadable="true"/>
</Host>
**idea classpath配置**
idea引入项目后,resources目录在eclipse中是在classpath下的,而在idea中变成在classpath外,导致项目无法识别配置文件。解决办法是把resources文件夹加入到classpath中,请参照此博文操作:[eclipse与idea中classpath配置路径不同导致迁移项目时的FileNotFoundException问题](http://blog.csdn.net/kesarchen/article/details/51193657)
**Mybatis逆向工程**
系统使用了Mybatis的逆向工程,依据数据库表自动生成domain和mapper(注:自动生成的代码都是针对单表,若需多表整合,则要手动修改实现),其中,针对每个数据库表,都会生成两个封装对象,可以认为example对象是对其相应的ORM映射对象查询条件的封装。逆向工程的实现--Mybatis Generator的代码托管在[https://github.com/mybatis/generator](https://github.com/mybatis/generator),代码down下来后,配置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>
<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/production_ms" userId="root"
password="root">
</jdbcConnection>
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="org.hqu.production_ms.domain"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProject:mapper映射文件生成的位置 -->
<sqlMapGenerator targetPackage="org.hqu.production_ms.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- targetPackage:mapper接口生成的位置 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="org.hqu.production_ms.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- 指定数据库表 -->
<table schema="" tableName="unqualify_apply"></table>
</context>
</generatorConfiguration>
修改完成后,执行main方法即可。需要注意的是,若要重新生成,则需把已经生成的文件删除,因为它不会自己覆盖,导致文件混乱。关于Mybatis逆向工程的更多详细信息,读者可以自行上网查阅。
\ No newline at end of file
</Host>
**idea classpath配置**
idea引入项目后,resources目录在eclipse中是在classpath下的,而在idea中变成在classpath外,导致项目无法识别配置文件。解决办法是把resources文件夹加入到classpath中,请参照此博文操作:[eclipse与idea中classpath配置路径不同导致迁移项目时的FileNotFoundException问题](http://blog.csdn.net/kesarchen/article/details/51193657)
**Mybatis逆向工程**
系统使用了Mybatis的逆向工程,依据数据库表自动生成domain和mapper(注:自动生成的代码都是针对单表,若需多表整合,则要手动修改实现),其中,针对每个数据库表,都会生成两个封装对象,可以认为example对象是对其相应的ORM映射对象查询条件的封装。逆向工程的实现--Mybatis Generator的代码托管在[https://github.com/mybatis/generator](https://github.com/mybatis/generator),代码down下来后,配置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>
<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/production_ms" userId="root"
password="root">
</jdbcConnection>
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="org.hqu.production_ms.domain"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProject:mapper映射文件生成的位置 -->
<sqlMapGenerator targetPackage="org.hqu.production_ms.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- targetPackage:mapper接口生成的位置 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="org.hqu.production_ms.mapper"
targetProject=".\src">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- 指定数据库表 -->
<table schema="" tableName="unqualify_apply"></table>
</context>
</generatorConfiguration>
修改完成后,执行main方法即可。需要注意的是,若要重新生成,则需把已经生成的文件删除,因为它不会自己覆盖,导致文件混乱。关于Mybatis逆向工程的更多详细信息,读者可以自行上网查阅。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册