I\'ve got what I think is a simple question. I\'ve seen examples both ways. The question is - \"why can\'t I place my annotations on the field?\". Let me give you an exam
You got me on the right track toolkit. Thanks. Here's the deal... Of course, my contrived example didn't include the whole story. My Widget class was actually much larger than the example I gave. I have several extra fields/getters and I was MIXING my annotations. So I was annotating the @Id on the field but others were being annotated on the getter.
So the moral of the story is that you cannot mix annotation locations. Either all annotations are on the fields or they are on the getter methods. Long time Java and Hibernate, new to Annotations. Learn something every day.
Once I knew what to Google for I came across this which was helpful - http://chstath.blogspot.com/2007/05/field-access-vs-property-access-in-jpa.html
Of course, this now brings up the question as to which is better from design and performance perspectives.