Can we add annotations to the decelerations instead to the getter methods.
I’m used to this
@Column(name="Part_ID")
public Long getPartId() {
return partId;
}
Can we use it like this
@Column(name="Part_ID")
private Long partId;
Thanks all.
Ravi
Yes, you can. See section 2.2.2.2 of the Hibernate annotations documentation:
So if you put your
@Idon a field, then Hibernate will look at annotations on the fields for the other properties. If you put@Idon a getter, then Hibernate will look at annotations on the other getters.