Mybatis——Lombok使用

Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.

使用步骤:

1.在IDEA中安装Lombok插件

2.在项目中导入lombok的jar包

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok-maven -->
<dependency>
   <groupId>org.projectlombok</groupId>
   <artifactId>lombok</artifactId>
   <version>1.18.10</version>
</dependency>

3.为实体类增加注解

@Data//无参构造,get,set,toString,hashcode,equals
@AllArgsConstructor
@NoArgsConstructor

 

posted @ 2020-08-31 19:09  Fabulo  阅读(215)  评论(0)    收藏  举报