It also depends on <access> element (see JPA 2.0 specification section 12.2.3.2).It depends on whether a field or a property (i.e. a getter method for id) is annotated with @Id.
ID may be provided in object-relation mapping file instead of @Id annotation, like:Remember that @Id must be present for every entity class (or its superclass).
Code: Select all
<attributes>
<id name="my_id_property" />
</attributes>