postgresql 配置文件

<?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="D:/javaLib/postgresql-42.1.4.jar" /> <context id="test" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin> <commentGenerator>
<!-- 这个元素用来去除指定生成的注释中是否包含生成的日期 false:表示保护 -->
<!-- 如果生成日期,会造成即使修改一个字段,整个实体类所有属性都会发生变化,不利于版本控制,所以设置为true -->
<property name="suppressDate" value="true" />
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="false" />
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="org.postgresql.Driver"
connectionURL="jdbc:postgresql://127.0.0.1:5432/erp"
userId="admin"
password="123456">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="包名" targetProject="文件路径"> <property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" /> </javaModelGenerator>
<!-- 生成映射文件的包名和位置 -->
<sqlMapGenerator targetPackage="包名" targetProject="文件路径"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator>
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="包名" implementationPackage="文件路径" argetProject="文件路径">
<property name="enableSubPackages" value="true" /> </javaClientGenerator>
<!-- 要生成哪些表 -->
<table schema="public" tableName="table_name"/> </context>
</generatorConfiguration>
  
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.robert.mybatis</groupId>
<artifactId>mybatisGenerator</artifactId>
<version>1.0-SNAPSHOT</version> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> <dependencies>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.8</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.8</version>
</dependency> </dependencies> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<version>3.3</version>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1201-jdbc4</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

  

 

mvn mybatis-generator:generate postgresql的更多相关文章

  1. Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) on project : <properties> resource does not exist

    使用mybatis-generator自动生成mapper.dao等文件时,报错如下: org.apache.maven.lifecycle.LifecycleExecutionException: ...

  2. Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: com.mysql.jdbc.Driver (mybatis逆向工程)

    springboot整合mybatis时出现的问题 解决方法:在pom.xml中plugin中加入单独依赖Mysql驱动包,问题便可解决 <plugin> <groupId>o ...

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

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

  4. mybatis generator使用(基于maven)

    1.添加maven依赖 <dependency> <groupId>org.mybatis.generator</groupId> <artifactId&g ...

  5. Mybatis Generator(定制化)代码生成器

    1.使用Mapper专用的MyBatis Generator插件 通用Mapper在1.0.0版本的时候增加了MyBatis Generator(以下简称MBG)插件,使用该插件可以很方便的生成实体类 ...

  6. mybatis.generator.configurationFile

    mybatis.generator.configurationFile 有一个更好的配置方法,可以不用在generateConfig.xml里面写死驱动的地址:如果你的mybatis连接也是在pom. ...

  7. 使用Mapper专用的MyBatis Generator插件

    使用Maven执行MBG 这里有一个完整的例子,Mybatis-Spring,下面讲解的内容出自这个例子. 使用Maven插件的一个好处是可以将Maven中的属性使用${property}形式在gen ...

  8. MyBatis Generator配置示例

    (一).MBG介绍 MyBatis Generator(MBG)是一个Mybatis的代码生成器,它可以用来生成可以访问(多个)表的基础对象.MBG解决了对数据库操作有最大影响的一些简单的CRUD(插 ...

  9. Mybatis Generator的model生成中文注释,支持oracle和mysql(通过实现CommentGenerator接口的方法来实现)

    自己手动实现的前提,对maven项目有基本的了解,在本地成功搭建了maven环境,可以参考我之前的文章:maven环境搭建 项目里新建表时model,mapper以及mapper.xml基本都是用My ...

随机推荐

  1. bzoj:1941: [Sdoi2010]Hide and Seek

    1941: [Sdoi2010]Hide and Seek Time Limit: 16 Sec  Memory Limit: 162 MBSubmit: 531  Solved: 295[Submi ...

  2. CodeForces-2015 HIAST Collegiate Programming Contest-Gym-100952A.水题 100952B.水题 100952C.回文字符串 100952D.杨辉三角处理组合数 其他题目待续。。。

    哈哈哈哈哈哈哈,最近一直在补题,改各种错误的代码,wa了20多遍,改到心态爆炸,改好之后,感觉世界都美好了(叉会腰~)... A. Who is the winner? time limit per ...

  3. UESTC30-最短路-Floyd最短路、spfa+链式前向星建图

    最短路 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) 在每年的校赛里,所有进入决赛的同 ...

  4. 安装linux的关键步骤

  5. iptables命令 高级网络

    http://man.linuxde.net/iptables iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分.可以直接配置,也可以通过许多前端和图形界面配置. ...

  6. sql 中文转拼音首字母

    http://blog.csdn.net/zhanglong_longlong/article/details/46772571 --可支持大字符集20000个汉字! create function ...

  7. dede文章插入分页符不起作用,编辑器中出现分页符,导致文章显示不全

    文章来源:小灰博客| 时间:2013-10-30 13:40:21| 作者:Leo | 1 条评论 文章分类:IT技术分享.PHP     标签: dedecms 今天偶尔发现给一篇dede下的长文章 ...

  8. Yourphp  使用说明

    https://wenku.baidu.com/view/c8d2e667cc1755270722088a.html 这个是站点的配置信息,比如:网站名称. LOGO .网站标题等 推荐位:个别可能用 ...

  9. 解决Sublime Text 3在GBK编码下的中文乱码问题听语音

    Sublime Text 3是我最喜欢的代码编辑器,没有之一,因为她的性感高亮代码配色,更因为它的小巧,但是它默认不支持GBK的编码格式,因此打开GBK的代码文件,如果里面有中文的话,就会乱码 工具/ ...

  10. util包就是用来放一些公用方法和数据结构的

    util包就是用来放一些公用方法和数据结构的