Although there are discussions recommendation is to use the annotation directly in the attribute , just like you are doing. Home
The intention of the ORM , in the case hibernate is to persist the state of the object, so the attributes represent the state of the object.
The intention of mapping an advisory method is questioned by the fact that rarely there is legitimacy in modifying an object's state directly by getting it. For example:
@Column
public String getUnidadeFederativa(){
uf = (uf == null ? "UF não informada" : uf)
return uf;
}
The above block may even make sense for a specific local use, but it exceeds the encapsulation boundaries of a originating record of a SGBD , in which consistency is mandatory for this context, the example above would not have constraint in the database with the UF table, ie the encapsulation of the information was affected arbitrarily by an advisory method .
So why is it possible to map an advisory method?
There are some specific situations that may be legitimate, but relative, if you need to map information into subclasses of Entity Classes ( third-party ) which does not implement no kind of persistence , the attributes of this entity would be private and you would have to overwrite the advisors and then map them with notes (example taken from Elnur Abdurrakhimov Stack Overflow US )