This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
� Annotations used with a setter method are ignored by the persistence provider for property-based access. �
Annotations should be applied to the getter methods when using property-based access. If you apply an annotation to a setter method, the annotation is ignored by the persistence provider.
Originally posted by Akhil Maharaj:
I understand that the foolowing code also from the same book is Property based persistence
Your code is using field-based access. Note that the @Id annotation (the only required annotation) is used on a field and not on a getter method of a property. [ October 08, 2008: Message edited by: Sergio Tridente ]
I think Sergio cleared your doubt. I was in same confusion when i started that chapter but if you just turn few pages you will understand that concept. if you still have doubt do post here i will try to clear.