on page 165 there is follwing :
@Entity
@Table(name="CATEGORY")
public class Category {
@Id @GeneratedValue
@Column(name = "CATEGORY_ID")
private Long id;
...
public Long getId() {
return this.id;
}
...
}
Mapping annotations are placed on the field declaration when direct field access
is enabled, as defined by the standard.
Whether field or property access is enabled for an entity depends on the position
of the mandatory @Id annotation. In the preceding example, it’s present on a
field, so all attributes of the class are accessed by Hibernate through fields. The
example before that, annotated on the getId() method, enables access to all
attributes through getter and setter methods.
--------------
my question is what is " all attributes of the class are accessed by Hibernate through fields" mean? all the attribute are defined as private , how can hinernate access the private attribute with out access the getter and setter method?
|