saveourtool / diktat

Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
https://diktat.saveourtool.com
MIT License
516 stars 38 forks source link

JPA: prohibit using `@Entity` annotation on data classes #1549

Open orchestr7 opened 1 year ago

orchestr7 commented 1 year ago

If the data class contains @.*ToMany annotation on any field AND @Entity annotation - we should raise a warning.

We should also create a NEW chapter called Spring/Enterprise for such kind of rules.

petertrr commented 1 year ago

Related: #802 (now can be solved with ignoreAnnotated, but more specific default configuration can be added if we will be doing a whole chapter on these things)