RBAC从零开始--Mybatis表映射实体
来源:互联网 发布:乔布斯是编程天才吗 编辑:程序博客网 时间:2024/05/22 12:23
映射代码下载
解压,配置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="mysql-connector-java-5.0.8-bin.jar"/> <context id="DB2Tables" targetRuntime="MyBatis3"> <commentGenerator> <property name="suppressDate" value="true"/> <property name="suppressAllComments" value="true"/> </commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/database(地址)" userId="root(用户名)" password="123(密码)"> </jdbcConnection> <javaTypeResolver> <property name="forceBigDecimals" value="false"/> </javaTypeResolver> () <javaModelGenerator targetPackage="com.xll.model(实体目录)" targetProject="./"> <property name="enableSubPackages" value="true"/> <property name="trimStrings" value="true"/> </javaModelGenerator> <sqlMapGenerator targetPackage="com.xll.mapper.xml(映射sql文件)" targetProject="./"> <property name="enableSubPackages" value="true"/> </sqlMapGenerator> <javaClientGenerator type="XMLMAPPER" targetPackage="com.xll.mapper(映射目录)" targetProject="./"> <property name="enableSubPackages" value="true"/> </javaClientGenerator> <table tableName="operate_log_info(表名)" domainObjectName="OperateLogInfo(对应的实体类名)" enableCountByExample="true" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="true"></table> <!-- <table tableName="employee_bank_account" domainObjectName="EmployeeBankAccount" enableCountByExample="true" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="true"></table> --> <!-- <table tableName="operation_records" domainObjectName="OperationRecord" enableCountByExample="true" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="true"></table> --> </context></generatorConfiguration>
中文注释,根据实际情况更改
cd sqlmapp目录下
键入cmd.txt里面的内容,等待代码生成!之后将生成后的代码拷贝到idea对应的包中去
下篇将编写用户操作日志代码,将运用AOP/注解来进行记录日志操作
阅读全文
0 0
- RBAC从零开始--Mybatis表映射实体
- Mybatis实体类和表映射
- RBAC从零开始--数据库表设计
- 使用MyBatis自动映射表创建实体类
- mysql 表结构生成java实体与mybatis映射
- mybatis自动生成映射实体类
- RBAC从零开始--文件配置
- mybatis的多表查询,映射到实体的应用(一)
- 总结Mybatis根据库表结构自动生成相关实体及映射文件
- 数据库表生成实体 包括注释 并生成mybatis Mapper映射 加入注释 通用SQL查询映射
- JPA实体多表映射
- 使用mybatis generater 自动生成实体类和映射文件
- MyBatis之自动生成实体类及映射文件《二》
- MyBatis逆向工程自动生成实体类和映射文件
- mybatis逆向生成实体类,接口类,映射xml文件
- mybatis反向生成实体类、dao层以及映射文件
- mybatis generator 反向生成实体类及映射文件
- MyBatis自动生成实体、DAO接口、Mapping映射文件
- 内置锁(二)--synchronized下的等待/通知机制
- ABP官方文档(二十)【领域事件】
- POJ1005
- PhpStorm下Laravel代码智能提示
- 异步服务端(一) boost asio
- RBAC从零开始--Mybatis表映射实体
- POJ 1825/2279(Young/Mr. Young's Picture Permutations-杨氏矩阵和钩子公式)
- Java day 10-11
- 2017年第二十二届 中国国际口腔设备材料展览会暨技术交流会会刊(参展商名录)
- SQL语句的性能查询
- Hbase原理、基本概念、基本架构
- Mybatis 框架 7
- Android 实现Retrofit2.0请求网络
- 《DELPHI赋》