基本使用
1. 特性1 - 自动生成id
@Data
public class User {
private Long id;
private String name;
private Integer age;
private String email;
}User user = new User();
user.setAge(23);
user.setEmail("2332fw@qq.com");
user.setName("woms");
userMapper.insert(user);特性2 - 下划线和驼峰自动转换
特性3 - 常用注解
特性4 - 排除非表字段的三种方式
4.1 关键字 transient 标示的字段不参与序列化过程
transient 标示的字段不参与序列化过程4.2 关键字 static 标示的字段
static 标示的字段4.3 @TableField(exist = false)
@TableField(exist = false)Last updated
Was this helpful?