Lombok 주석이 상속과 함께 작동하지 않습니다.

Nov 16 2020

부모 클래스 ( File A.java) 와 같은 것이 있습니다.
모든 클래스는 name.

나는에 사용하는 경우 기능, 그것은 작동 하는 부분입니다 . 그러나 At least IntelliJ is not showing에서 함수 를 사용할 수 없습니다 . 그러나 상속 은 예상대로 작동합니다.File X.java@With.withDescription("xxx")File B.java
@With.withName("xxx");
.withName("xxx")
.setName("xxx")

예상대로 작동하는 방법을 아십니까? 를 사용하는 이 답변 을 보았지만 / @SuperBuilder없이하고 싶었습니다.@Builer@SuperBuilder

파일 A.java

@Getter
@Setter
@With
@MappedSuperclass
public class A {
  public String name;
}

파일 B.java

@Getter
@Setter
@With
@AllArgsConstructor
@NoArgsConstructor
@Entity
public class B extends A {
  public String description;
}

파일 X.java

public class X {
  public void x() {
    var b = new B().withDescription("xxx"); // it works
    b.withName("xxx"); // is NOT working.
    b.setName("xxx"); // only set is working, even it's only inherited.
}

답변

1 RaminPK Nov 16 2020 at 00:23

@AllArgsConstructorA 에 추가해야합니다 .