@Target is deprecated but is necessary for @Any

Hello,

@Target has been deprecated since version 6.2, and it is recommended to use the targetEntity attribute instead. However, for @Any and @ManyToAny, this attribute does not exist.
Should I still use @Target in these cases, in your opinion?

Thank you.

Why would you need to set a target type? Any associations are inherently polymorphic and usually use a declared type of an interface or even just Object.

1 Like

Indeed… I was tricked by an alert from Intellij IDE.
Thank you.
image