Lombok.hashCode issue with “java.lang.StackOverflowError: null”

后端 未结 2 388
挽巷
挽巷 2020-12-28 13:48

I have two tables has one to one relationship as below:

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Book {
  @Id
  @GeneratedValue(stra         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 14:18

    lambok resulted to a circular dependency

    reason: the toString() method

    solution: replace one of your models to

    @Getter
    @Setter
    public class BookDetail
    

    instead of

    @Data
    public class BookDetail
    

提交回复
热议问题