<?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="WebContent/WEB-INF/lib/mysql-connector-java-5.1.26-bin.jar" /> <context id="DB2Tables" targetRuntime="MyBatis3"> <commentGenerator> <property name="suppressAllComments" value="true" /><!-- 是否取消注释 --> <property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 --> </commentGenerator> <!-- 数据库连接信息 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/ehcache_db" userId="root" password="root"> </jdbcConnection> <!-- 只有一个属于forceBigDecimals,默认false。 如果字段精确超过0,生成BigDecimal 如果字段精确是0,总长度10-18生成Long;如果字段精确是0, 总长5-9生成Integer; 如果字段精确是0,总长小于5生成Short; 如果forceBigDecimals为true,统一生成BigDecimal --> <javaTypeResolver> <!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) --> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!--生成Model.java文件 --> <javaModelGenerator targetPackage="cn.zifangsky.model" targetProject="src/main/java"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="false" /> <!-- 是否针对string类型的字段在set的时候进行trim调用 --> <property name="trimStrings" value="true" /> </javaModelGenerator> <!-- 生成Mapper.xml文件 --> <sqlMapGenerator targetPackage="sqlmaps" targetProject="src/main/resources"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="false" /> </sqlMapGenerator> <!-- 生成Mapper.java文件,即dao层 --> <javaClientGenerator type="XMLMAPPER" targetPackage="cn.zifangsky.mapper" targetProject="src/main/java"> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <!-- 待生成的数据库中的表名,生成一个表对应的Java和xml文件就需要配置一段 --> <table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context> </generatorConfiguration>
<project default="genfiles" basedir=".">
<property name="generated.source.dir" value="${basedir}" />
<path id="ant.run.lib.path">
<pathelement location="${basedir}/WebContent/WEB-INF/lib/mybatis-generator-core-1.3.2.jar"/>
</path>
<target name="genfiles" description="Generate the files">
<taskdef name="mbgenerator" classname="org.mybatis.generator.ant.GeneratorAntTask" classpathref="ant.run.lib.path"/>
<mbgenerator overwrite="true" configfile="generatorConfig.xml" verbose="false">
<propertyset>
<propertyref name="generated.source.dir" />
</propertyset>
</mbgenerator>
</target>
</project>
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) DEFAULT NULL,
`password` varchar(64) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
`birthday` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', '123456', 'admin@qq.com', '2000-01-02');
INSERT INTO `user` VALUES ('2', 'test', '1234', 'test@zifangsky.cn', '1990-12-12');
INSERT INTO `user` VALUES ('3', 'xxxx', 'xx', 'xx@zifangsky.cn', '1723-06-21');
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有