This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Annotating the fields of the entity will cause the provider to use field access to get and set the state of the entity. Getter and setter methods may or may not be present, but if they are present, they are ignored by the provider
Originally posted by Jothi Shankar Kumar Sankararaj: But how will I get and set my values?
Furthermore, it is dictated by the specification. Accordingly to section 2.1 (Requirements on the Entity class):
The persistent state of an entity is represented by instance variables, which may correspond to Java Beans properties. An instance variable may be directly accessed only from within the methods of the entity by the entity instance itself. Instance variables must not be accessed by clients of the entity. The state of the entity is available to clients only through the entity’s accessor methods (getter/setter methods) or other business methods. Instance variables must be private, protected, or package visibility.