JPA Annotations for Classes
JPA defines three types of persistable classes which are set by the following annotations:
- javax.persistence.Embeddable - JPA Annotation
- javax.persistence.Entity - JPA Annotation
- javax.persistence.MappedSuperclass - JPA Annotation
Chapter 2 of the ObjectDB manual explains these annotations in detail.
Entity and mapped super classes can be further configured by annotations that specify cache preferences and lifecycle event listener policy (as explained in chapter 3):
- javax.persistence.Cacheable - JPA Annotation
- javax.persistence.EntityListeners - JPA Annotation
- javax.persistence.ExcludeDefaultListeners - JPA Annotation
- javax.persistence.ExcludeSuperclassListeners - JPA Annotation
Another JPA class annotation defines an ID class:
ID classes are useful in representing composite primary keys as explained in the Primary Key section of the ObjectDB manual.