0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JPA:javax.persistence.EntityNotFoundException

Posted at

@NotFound(action = NotFoundAction.IGNORE)で解決

JPAのエンティティクラスに多対一のリレーションシップを設定したデータ取得時に javax.persistence.EntityNotFoundException がスローされました。

@ManyToOne(optional = true) では回避できず・・・。
Qiitaで見つけた記事で無事に解決しました。

@ManyToOne(fetch = FetchType.EAGER)
@NotFound(action = NotFoundAction.IGNORE)  // これで解消
@JoinColumns({
    @JoinColum(name = "no", insertable = false, updatable = false)
    @JoinColum(name = "detailNo", insertable = false, updatable = false)
})
private Meisai meisai;

References

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?