SpringBoot-JPA-NotAManagedType解決記録
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
* 目次 [#a2c902a6]
#contents
* Spring Boot JPA「Not a managed type」エラーの解決記録 [...
** 概要 [#m121dc85]
Spring Boot + Spring Data JPAで「Not a managed type: clas...
** 発生した現象 [#u681760d]
org.springframework.beans.factory.UnsatisfiedDependencyE...
** 原因 [#i36fa1ef]
- Spring Boot 3.x + JDK 17以降では、`javax.persistence.*`...
- エンティティクラスや複合主キー(@Embeddable等)でも全て...
- 依存ライブラリ(pom.xml)も `jakarta.*` 系が必要。
** 解決方法 [#g5d3b11a]
+ エンティティクラス、IDクラスのimportを全て `jakarta.per...
+ @EntityScanなどの設定パスが正しいか再確認。
+ 不要な@Config/@ComponentScan等は削除。
*** 実際の修正例 [#j59299e8]
// 修正前
import javax.persistence.Entity;
import javax.persistence.Embeddable;
// 修正後
import jakarta.persistence.Entity;
import jakarta.persistence.Embeddable;
** 感想・教訓 [#e6b10af9]
- Spring Boot 3.x以降ではjakarta移行に要注意。
- エラーメッセージだけではimportの違いに気づきにくい。
- 公式ドキュメントやStack Overflowの事例が非常に役立つ。
*** 参考になったサイト [#mdc08d40]
https://stackoverflow.com/questions/76174604/spring-data-...
終了行:
* 目次 [#a2c902a6]
#contents
* Spring Boot JPA「Not a managed type」エラーの解決記録 [...
** 概要 [#m121dc85]
Spring Boot + Spring Data JPAで「Not a managed type: clas...
** 発生した現象 [#u681760d]
org.springframework.beans.factory.UnsatisfiedDependencyE...
** 原因 [#i36fa1ef]
- Spring Boot 3.x + JDK 17以降では、`javax.persistence.*`...
- エンティティクラスや複合主キー(@Embeddable等)でも全て...
- 依存ライブラリ(pom.xml)も `jakarta.*` 系が必要。
** 解決方法 [#g5d3b11a]
+ エンティティクラス、IDクラスのimportを全て `jakarta.per...
+ @EntityScanなどの設定パスが正しいか再確認。
+ 不要な@Config/@ComponentScan等は削除。
*** 実際の修正例 [#j59299e8]
// 修正前
import javax.persistence.Entity;
import javax.persistence.Embeddable;
// 修正後
import jakarta.persistence.Entity;
import jakarta.persistence.Embeddable;
** 感想・教訓 [#e6b10af9]
- Spring Boot 3.x以降ではjakarta移行に要注意。
- エラーメッセージだけではimportの違いに気づきにくい。
- 公式ドキュメントやStack Overflowの事例が非常に役立つ。
*** 参考になったサイト [#mdc08d40]
https://stackoverflow.com/questions/76174604/spring-data-...
ページ名: