1.运行完mybatis-generator没有出现问题,但是代码看不到,出现这种东西:

你需要使用相对路径,如项目名+/src/main/java,就可以解决了

2.附录我的代码以供参考:

<?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> <!-- 指定数据连接驱动jar地址 -->
<classPathEntry location="D:/Java/maven-repository/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar" /> <!-- 一个数据库一个context -->
<context id="infoGuardian" >
<!-- 注释 -->
<commentGenerator >
<property name="suppressAllComments" value="false"/><!-- 是否取消注释 -->
<property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳-->
</commentGenerator> <!-- jdbc连接 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/mall?characterEncoding=utf-8" userId="huhu"
password="huhu" /> <!-- 类型转换 -->
<javaTypeResolver>
<!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver> <!-- 生成实体类地址 -->
<javaModelGenerator targetPackage="com.mall.pojo"
targetProject="mall/src/main/java" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="false"/>
<!-- 是否针对string类型的字段在set的时候进行trim调用 -->
<property name="trimStrings" value="true"/>
</javaModelGenerator> <!-- 生成mapxml文件 -->
<sqlMapGenerator targetPackage="mappers"
targetProject="mall/src/main/resources" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator> <!-- 生成mapxml对应client,也就是接口dao -->
<javaClientGenerator targetPackage="com.mall.dao"
targetProject="mall/src/main/resources" type="XMLMAPPER" >
<!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator> <!-- 配置表信息 表名,生成的类名,-->
<table schema="mall" tableName="mmall_cart"
domainObjectName="Cart" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
<!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample
是否生成 example类 --> </table>
<table schema="mall" tableName="mmall_category"
domainObjectName="Category" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table> <table schema="mall" tableName="mmall_order"
domainObjectName="Order" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table> <table schema="mall" tableName="mmall_order_item"
domainObjectName="OrderItem" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table> <table schema="mall" tableName="mmall_pay_info"
domainObjectName="PayInfo" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table> <table schema="mall" tableName="mmall_product"
domainObjectName="Product" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
<!-- 指定列的java数据类型 -->
<columnOverride column="sub_images" jdbcType="VARCHAR" />
<columnOverride column="detail" jdbcType="VARCHAR" />
</table> <table schema="mall" tableName="mmall_user"
domainObjectName="User" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table> <table schema="mall" tableName="mmall_shipping"
domainObjectName="Shipping" enableCountByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
enableUpdateByExample="false">
</table>
</context>
</generatorConfiguration>

关于mybatis-generator的问题的更多相关文章

  1. mybatis Generator生成代码及使用方式

    本文原创,转载请注明:http://www.cnblogs.com/fengzheng/p/5889312.html 为什么要有mybatis mybatis 是一个 Java 的 ORM 框架,OR ...

  2. 使用MyBatis Generator自动创建代码(dao,mapping,poji)

    连接的数据库为SQL server2008,所以需要的文件为sqljdbc4.jar 使用的lib库有: 在lib库目录下新建一个src文件夹用来存放生成的文件,然后新建generatorConfig ...

  3. mybatis generator 自动生成dao层映射代码

    资源: doc url :http://www.mybatis.org/generator/ download:https://github.com/mybatis/generator/release ...

  4. mybatis generator maven插件自动生成代码

    如果你正为无聊Dao代码的编写感到苦恼,如果你正为怕一个单词拼错导致Dao操作失败而感到苦恼,那么就可以考虑一些Mybatis generator这个差价,它会帮我们自动生成代码,类似于Hiberna ...

  5. mybatis generator.xml 配置 自动生成model,dao,mapping

    generator.xml文件: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE gener ...

  6. Mybatis generator的使用

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...

  7. MyBatis Generator作为maven插件自动生成增删改查代码及配置文件例子

    什么是MyBatis Generator MyBatis Generator (MBG) 是一个Mybatis的代码生成器,可以自动生成一些简单的CRUD(插入,查询,更新,删除)操作代码,model ...

  8. 记一次 IDEA mybatis.generator 自定义扩展插件

    在使用 idea mybatis.generator 生成的代码,遇到 生成的代码很多重复的地方, 虽然代码是生成的,我们也不应该允许重复的代码出现,因为这些代码后期都要来手动维护. 对于生成时间戳注 ...

  9. Mybatis Generator生成工具配置文件详解

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...

  10. MyBatis Generator 详解

    MyBatis Generator中文文档 MyBatis Generator中文文档地址:http://mbg.cndocs.tk/ 该中文文档由于尽可能和原文内容一致,所以有些地方如果不熟悉,看中 ...

随机推荐

  1. gunicorn Arbiter 源码解析

    如前文所述,Arbiter是gunicorn master进程的核心.Arbiter主要负责管理worker进程,包括启动.监控.杀掉Worker进程:同时,Arbiter在某些信号发生的时候还可以热 ...

  2. java表单重复提交常用解决办法

    最近在看些基础的东西,顺便做下笔记.相信大家在平时网页使用中,经常会有按钮重复点击,然后点不动刷新,还有当网络延时比较厉害点了没反应在点击的重复提交.为了避免这种情况,总结了一下4点处理方案 表单重复 ...

  3. React学习总结(一)

    React学习总结 一.什么是React? 是Facebook公司开发的一套JS库 React的详细介绍https://www.jianshu.com/p/ae482813b791 二.老版本Reac ...

  4. 【java设计模式】【结构模式Structural Pattern】合成模式Composite Pattern

    package com.tn.pattern; import java.util.Vector; public class Client { public static void main(Strin ...

  5. [Maximize ∑arr[i]*i of an Array]

    Given an array of N integers. Your task is to write a program to find the maximum value of ∑arr[i]*i ...

  6. Visual Studio 我的插件

    为了以后开发方便,自己记录下好用的Visual Studio 扩展 1.outline if折叠 2.Indent Guides 代码块虚线 3.CodeMaid 大文件里能够重构文件,快速定位方法. ...

  7. 根据NPOI 读取一个excel 文件的多个Sheet

    大家都知道NPOI组件可以再你本地没有安装office的情况下来 读取,创建excel文件.但是大家一般都是只默认读取一个excel文件的第一个sheet.那么如果要读取一个excel 的所有shee ...

  8. Siamese Network理解

    提起siamese network一般都会引用这两篇文章: <Learning a similarity metric discriminatively, with application to ...

  9. 【深度学习系列】一起来参加百度 PaddlePaddle AI 大赛吧!

    写这个系列写了两个月了,对paddlepaddle的使用和越来越熟悉,不过一直没找到合适的应用场景.最近百度搞了个AI大赛,据说有四个赛题,现在是第一个----综艺节目精彩片段预测 ,大家可以去检测一 ...

  10. Linux下磁盘监控及系统版本-CPU-内存等查看

    1.磁盘IO监控工具 iotop 输入命令:iotop   主要查看程序使用的磁盘IO的信息 安装:yum -y install iotop 第一行:10:01:23 — 当前系统时间126 days ...