SpringBootMybatis 关于Mybatis-generator-gui的使用|数据库的编码注意点|各项复制模板
mysql注意点:
.有关编码
create table user(
id int primary key auto_increment,
`name` varchar(),
`password` varchar()
)ENGINE=InnoDB AUTO_INCREMENT= DEFAULT CHARSET=utf8;
需要加上引擎的注释和默认数据库编码
application.properties的默认写法
#数据源
spring.datasource.url=jdbc:mysql://120.78.206.78:3306/testMybatisClient?useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Root123.. #用来实例化mapper接口
mybatis.type-aliases-package=com.littlepage.mapper
#对应的sql映射
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
#首页
server.servlet.context-path=/
#日志级别
logging.level.com.littlepage.mybatis.mapper=debug #连接池
spring.datasource.hikari.minimum-idle=3
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.max-lifetime =30000
spring.datasource.hikari.connection-test-query=SELECT 1
MapperScan
@SpringBootApplication
@MapperScan("com.littlepage.mapper")
public class MybatisApplication { public static void main(String[] args) {
SpringApplication.run(MybatisApplication.class, args);
} }
启动类进行mapper的扫描
SpringBootMybatis 关于Mybatis-generator-gui的使用|数据库的编码注意点|各项复制模板的更多相关文章
- MyBatis Generator 生成器把其他数据库的同名表生成下来的问题
[问题] 使用MyBatis Generator生成器时,发现Mapper文件中出现字段与连接数据库不符,经过查找发现该表是其他数据库的同名表的字段. [解决问题] 在构造文件中,这里是generat ...
- Mybatis分页-利用Mybatis Generator插件生成基于数据库方言的分页语句,统计记录总数 (转)
众所周知,Mybatis本身没有提供基于数据库方言的分页功能,而是基于JDBC的游标分页,很容易出现性能问题.网上有很多分页的解决方案,不外乎是基于Mybatis本机的插件机制,通过拦截Sql做分页. ...
- mybatis generator插件开发
mybatis现在普遍使用的每一个人DAO框架.mybatis generator它可以基于数据库中的表结构,生成自己主动mybatis代码和配置文件,方便使用,当然,实际的使用过程中.generat ...
- javaweb各种框架组合案例(五):springboot+mybatis+generator
一.介绍 1.springboot是spring项目的总结+整合 当我们搭smm,ssh,ssjdbc等组合框架时,各种配置不胜其烦,不仅是配置问题,在添加各种依赖时也是让人头疼,关键有些jar包之间 ...
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...
- Mybatis Generator生成数据库自带的中文注释
1.相关jar包 <!-- mybatis生成 jar包 --> <dependency> <groupId>org.mybatis.generator</g ...
- 利用mybatis generator实现数据库之间的表同步
项目背景: 项目需要对两个服务器上的表进行同步,表的结构可能不一样.比如服务器A上的表i同步数据到服务器B上的表j,i和j的结构可能不一样,当然大部分字段是一样的.项目看起来很简单,网上一搜也是很多, ...
- MyBatis Generator 生成数据库自带中文注释
1. maven依赖 <!-- mybatis生成 jar包 --> <dependency> <groupId>org.mybatis.generator< ...
- idea中mybatis generator自动生成代码配置 数据库是sqlserver
好长时间没有写博客了,最近公司要用java语言,开始学习java,属于初学者,今天主要记录一下mybatis generator自动生成代码,首先在如下图的目录中新建两个文件,如下图 generato ...
随机推荐
- leetcode 166分数到小数
手动排除特殊情况: 对于一般情况,使用位运算和加减法来计算除法,使用sign记录结果符号:(这部分为leetcode 29题的答案) 使用hashmap来记录循环体出现的开始位置(如果有的话),使用f ...
- leetcode23 合并k个排序链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...
- python问题笔记
1.for...in...:和while...:循环末端都可以有一个else:语句,但他仅在循环不是由break语句退出时才会被运行 2.input raw input区别 一. 可以看到:这两个函数 ...
- [Python]操作shell脚本报错Permission denied
问题: In []: os.system('./test_shell_no_para.sh') : ./test_shell_no_para.sh: Permission denied Out[]: ...
- [python]自动计算1-100的平方和
def power(x,n): s=1 while n > 0: n = n-1 s = s * x return sm=0for i in range(1,101) : n=power(i,2 ...
- nodejs 之简单web服务器
1.service.js var http=require('http');//引入http模块 var fs=require('fs');//fs模块 var path=require('path' ...
- Appium+python--元素定位uiautomatorviewer
一.启动uiautomatorviewer.bat 1. 打开uiautomatorviewer软件,如下图所示,本机路径:E:\downloads\android-sdk_r23.0.2-windo ...
- apache通过rewrite限制某个目录
1.<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_URI} ^.*/tmp/* [NC] RewriteRule ...
- 【MM系列】SAP SAP库龄报表逻辑理解
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP SAP库龄报表逻辑理解 ...
- maven坐标Dependencies和Exclusions详解
1.概念介绍 Dependencies:是可选依赖(Optional Dependencies) Exclusions:是依赖排除(Dependency Exclusions) 2.Dependenc ...