1.在IEDA中安装Lombok的插件!
- 先找到file->settings
2.Plugins直接下载
2.在项目中导入lombok的jar包
我使用的是mybatis 所以在pom.xml中配置
将下面代码加入即可,如果爆红,只需要点击maven那个刷新下载
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
</dependency>
3.在实体类上加入注解即可使用!
@Getter and @Setter
@FieldNameConstants
@ToString
@EqualsAndHashCode
@AllArgsConstructor, @RequiredArgsConstructor and @NoArgsConstructor
@Log, @Log4j, @Log4j2, @Slf4j, @XSlf4j, @CommonsLog, @JBossLog, @Flogger, @CustomLog
@Data
@Builder
@SuperBuilder
@Singular
@Delegate
@Value
@Accessors
@Wither
@With
@SneakyThrows
@val
@var
experimental @var
@UtilityClass