01 用Maven插件生成Mybatis代码
http://blog.csdn.net/gufeng672/article/details/27196347
02 generatorConfig.xml文件配置
http://stackoverflow.com/questions/32806225/mybatis-cannot-generator-using-oracle-database
03 MyBatis Generator官网
http://www.mybatis.org/generator/running/runningWithMaven.html
04 我的问题:classPathEntry的配置。以下是我的配置文件:
<?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">
<!-- 使用 mvn mybatis-generator:generate -->
<generatorConfiguration>
<properties resource="jdbc.properties"/>
<classPathEntry location="${maven.repository}\com\oracle\ojdbc6\11.2.0.1.0\ojdbc6-11.2.0.1.0.jar" />
<context id="shiroTables" targetRuntime="MyBatis3" defaultModelType="flat">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="${oracle.driver}"
connectionURL="${oracle.url}"
userId="${oracle.username}"
password="${oracle.password}">
</jdbcConnection>
<javaModelGenerator targetPackage="qooco.crm.model"
targetProject="src/main/java">
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="sqlMapperXml"
targetProject="src/main/resources">
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER"
targetPackage="qooco.crm.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- schema:指定dao文件所属分类文件夹| doaminObjectName:指定生成对象名 -->
<table schema="" tableName="testKelvin" domainObjectName="TestKelvin"
enableCountByExample="false"
enableDeleteByExample="false"
enableUpdateByExample="false"
selectByExampleQueryId="false"
enableSelectByExample="false">
<generatedKey column="id_" sqlStatement="assigned" identity="true"/>
</table>
</context>
</generatorConfiguration>
分享到:
相关推荐
本文主要介绍 Maven插件生成Mybatis代码,现在做开发的朋友有好多用Maven 来管理代码,这里给大家举个例子,有需要的同学可以看下
Maven插件之mybatis-generator自动生成实体代码的demo
mybatis反向生成maven插件完美生成代码,运行generator插件 运行方法:在eclipse 中,选择pom.xml文件,击右键先择Run AS——>Maven Build… ——>在Goals框中输入:mybatis-generator:generate 运行即可 这样,...
利用maven的MyBatis Generator 插件自动创建代码示例利用maven的MyBatis Generator 插件自动创建代码示例利用maven的MyBatis Generator 插件自动创建代码示例
1.Mybatis Plus代码生成器 1.1.自定义配置模板 1.2.自定义表-实体映射信息 1.3.多数据源管理 1.4.操作记忆功能 1.5.操作化繁为简 2.工程化(maven,spring boot) 2.1.生成maven工程 2.2.生成...
项目导入成功后 生成方式 : 选中pom.xml运行Run As --- Goals:mybatis-generator:generate
mybatis的maven的jar,可以方便的使用maven插件,一键生成sql
实用mybatis的maven插件实现自动生成实体dao接口等代码,内附详细注释
本源码为基于Mybatis-Plus的Maven代码生成插件设计,共包含25个文件,其中java文件14个,vm文件6个,gitignore文件1个,project文件1个,LICENSE文件1个,md文件1个,xml文件1个。该项目是一个Mybatis-Plus Maven...
花了两天时间,将springboot框架搞定,maven+springboot+ mybatis+mysql+代码自动插件+log4j日志
在idea下使用maven的mybatis-generator-maven-plugin插件自动生成实体映射文件
根据标准sql文件生成mybatis-plus-join代码(只支持mysql) 根据自定义接口文档生成接口api代码 根据自定义接口文档生成接口实现代码和service定义 根据自定义接口文档生成基于swagger-ui风格的代码和默认的...
maven安装与配置 安装和配置Maven的步骤如下:12 确保已安装JDK。Maven 3.9+版本需要JDK 8或更高版本。可以通过输入java -version来检查JDK是否安装以及其版本。 下载Maven。访问Maven官网下载最新版本,例如...
SpringBoot+MyBatis+Maven搭建的小demo。支持mybatis-generator插件自动生成mybatis代码。
开发工具:idea(任意版本) 开发环境:jdk1.8,tomcat8.5,maven3.5,数据库mysql
为了在项目中快捷方便的代码生成,将mybatis-plus-generator封装为了一个maven的插件`mybatis-plus-generator-maven-plugin。使用文档参考:https://blog.csdn.net/xiweiller/article/details/103072165
maven安装与配置 确保已安装JDK。Maven 3.9+版本需要JDK 8或更高版本。可以通过输入java -version来检查JDK是否安装以及其版本。 下载Maven。访问Maven官网下载最新版本,例如3.9.1。对于Windows用户,通常下载...
mybatis的使用可以自动生成dao层和它所对应的映射文件以及基础类,maven的使用省略了手动导包的过程,更加的方便快捷,使用这些工具必不可少的就是插件的安装
NULL 博文链接:https://terry0501.iteye.com/blog/2427963
mybatis-generator有三种用法:命令行、eclipse插件、maven插件。 个人在此用的是命令行. 使用方法: 1.下载,解压.加入项目中 2.更改config.xml中数据库连接信息和生成文件的目标包路径 3.保存退出 4.点击code.bat...