How solve javax.persistence.EntityNotFoundException with JPA (not by using @NotFound)

后端 未结 6 829
悲哀的现实
悲哀的现实 2021-02-05 10:28

We are using JPA to load some stuff from a database. Some entities may have optional relationships between them, e.g.

@Entity
public class First {
    ....
    @         


        
6条回答
  •  情书的邮戳
    2021-02-05 10:53

    It happens when you delete the associated entity id. In my case I had Product table depending upon Brand table. I deleted a row or an entity of brand id to which one of the product instance was depending upon.

提交回复
热议问题