lombok注解@Data使用在继承类上时出现警告Generating equals/hashCode implementation but without a call to superclass, even though this class ...

Generating equals/hashCode implementation but without a call to superclass, even though this class
does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)'
to your type.

解决方法:

1)在子类上面直接加

@EqualsAndHashCode(callSuper = true)

 这个方法在每个子类上都要加入。

2)在实体类的目录里加入一个config

lombok.config内容如下:

config.stopBubbling=true

lombok.equalsAndHashCode.callSuper=call

以配制文件的形式,可以不用在子类上加入,全局有效。 

pom.xml还要加入下面的

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
          <source>1.8</source>
          <target>1.8</target>
      </configuration>
</plugin>

从单词的意思来看就是指定编译jdk的版本,以及编译了。

 参考:

https://blog.csdn.net/feinifi/article/details/85275280

原文地址:https://www.cnblogs.com/jiduoduo/p/14072680.html