首页 > 其他分享 >MyBatis框架:第十一章:mybatis 逆向工程

MyBatis框架:第十一章:mybatis 逆向工程

时间:2022-10-06 17:24:11浏览次数:72  
标签:username 逆向 varchar admin MyBatis user mybatis password email

MyBatis逆向工程,简称MBG。是一个专门为MyBatis框架使用者定制的代码生成器。可以快速的根据表生成对应的映射文件,接口,以及Bean类对象。
在Mybatis中,有一个可以自动对单表生成的增,删,改,查代码的插件。

叫 mybatis-generator-core-1.3.2。

它可以帮我们对比数据库表之后,生成大量的这个基础代码。
这些基础代码有:
1、数据库表对应的javaBean对象
2、这些javaBean对象对应的Mapper接口
3、这些Mapper接口对应的配置文件

16.1、准备数据库表

create database mbg;

use mbg;

create table t_user(
id int primary key auto_increment,
username varchar(30) not null unique,
password varchar(40) not null,
email varchar(50)
);

insert into t_user(username,password,email) values(‘admin’,‘admin’,‘[email protected]’);
insert into t_user(username,password,email) values(‘wzg168’,‘123456’,‘[email protected]’);
insert into t_user(username,password,email) values(‘admin168’,‘123456’,‘[email protected]’);
insert into t_user(username,password,email) values(‘lisi’,‘123456’,‘[email protected]’);
insert into t_user(username,password,email) values(‘wangwu’,‘123456’,‘[email protected]’);

create table t_book(
id int primary key auto_increment,
name varchar(50),
author varchar(50),
price decimal(11,2),
sales int,
stock int,
img_path varchar(100)
);

 


更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/120382589

 

标签:username,逆向,varchar,admin,MyBatis,user,mybatis,password,email
From: https://www.cnblogs.com/wangchuanxinshi/p/16758031.html

相关文章