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.

Springでのエラー(個人用)

Last updated at Posted at 2023-05-17

①GradleでValidationを使用すると、「〇〇を型に解決できません」とのエラーが発生する

##解決方法
build.gradle の dependencies にて以下を設定する必要がある。
・javax.validation:validation-api (Bean Validation API)

dependencies{
  implementation 'javax.validation:validation-api:2.0.1.Final'
}

@Controller is not an annotation

解決方法

クラス名をController以外にする。

③Repositoryのdeleteで自動生成メソッドが呼び出せないエラーの原因と対処方法

javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call

解決方法

Controllerクラスに@Transactionalをつける

まとめ

これで、GradleでValidationを記載することができる。
色々と設定がする必要があって面倒だなと感じている今日この頃。

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?