In Hibernate, placing there @Id
annotation
before the field declaration itself
@Id
private int id;
and before its getter and setter
@Id
public int getId() { return this.id; }
public int setId(..) { .. }
are two different things. This difference takes effect if there's some processing in getter/setter.
The Q is, is there such an issue for non-key fields-- those without the @Id
annotation?
My key fields aren't any processed. However, among the others, I've got some fields that i am validating/changing the values before setting. For those fields, should i put the annotations before their getters-setters?
I didn't hit a brick wall as far as I could observe. however - would like to make sure.
TIA.
Note: saw the useful discussion: Where to put hibernate annotations?.