Hibernate OneToMany java.lang.StackOverflowError

后端 未结 10 1019
傲寒
傲寒 2020-12-07 19:58

It\'s my first question here on stack, so please be gentle :D

I\'m trying to create hibernate OneToMany relationship. When I try to fetch some data from my DB, I\'m

10条回答
  •  猫巷女王i
    2020-12-07 21:01

    I had similar issue and in my case nothing of this didnt help.

    Helped this one approach:

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "order_id")
    @Fetch(value = FetchMode.SUBSELECT)
    private List orderLines; 
    

    name = "order_id" is a foreign key column from Product table.

    And i didnt put anything in Product entity.

提交回复
热议问题