-2

"UnnecessaryAnnotationValueElement: Avoid the use of value in annotations when its the only element"

@Query(value = "SELECT t FROM IntraPaymentTransaction t WHERE exchangeBuyAmount.currency <> exchangeSellAmount.currency")

I use this query in my repository but PMD return "UnnecessaryAnnotationValueElement: Avoid the use of value in annotations when its the only element" DO you have any idea?

ali
  • 9
  • 2
  • 1
    Did you try to search the internet for the error message? https://pmd.github.io/pmd/pmd_rules_java_codestyle.html#unnecessaryannotationvalueelement – Torben Apr 17 '23 at 10:20
  • The PMD message is clear. Remove the value from annotation definition. Write only @Query("SELECT...") – Mar-Z Apr 17 '23 at 11:24

1 Answers1

0

When value is the only element, it doesn't have to be specified.

@Query(value = "SELECT t FROM IntraPaymentTransaction t WHERE exchangeBuyAmount.currency <> exchangeSellAmount.currency")

can be replaced by:

@Query("SELECT t FROM IntraPaymentTransaction t WHERE exchangeBuyAmount.currency <> exchangeSellAmount.currency")
Stultuske
  • 9,296
  • 1
  • 25
  • 37