Java documentation says:
As a matter of style, programmers should always use this annotation on
the most deeply nested element where it is effective. If you want to
suppress a warning in a particular method, you should annotate that
method rather than its class.
I didn’t really feel any benefits of using this annotation. But its not really hard to put it everywhere. Should I use it for all methods of the dao classes that interact with the Hibernate (getting and saving some data)?
You might even want to use it on idividual fields, for example:
@SuppressWarnings(“unchecked”)
List l = query.list();
As the doc says, use it at the lowest possible level in order to avoid hiding the warning in situations where it should not be suppressed, that you can fix through propery use of generics (in the example above you can’t since HQL-based queries don’t support generics (yet) ).