...
Annotation | Explanation |
---|---|
@Column | Define columns, column names, and specifications about size and nullability. |
@ElementCollection, @CollectionTable | Used to define collections of non JPA objects (like a set of String). |
@Entity | Used to define JPA-tracked objects. |
@Enumerated | Used to indicate fields that have enumerated values. |
@id @GeneratedValue | Used to managed identifier fields and ID strategy. |
@ManyToOne, @OneToOne, @OneToMany | Used to define object relationships between different @Entity annotated classes. |
@MappedSuperclass | Used for abstract superclasses to indicate their fields should be included in persistence of concrete subclasses. |
@Table | Used to indicate table names for objects. Default underscore-based naming convention is used. |
@Temporal | Used @TemporalUsed for date fields. |
@Transient | Used to avoid persistence of fields, these are typically used for DTO fields as we reuse the objects for data transfer. |
@UniqueConstraint | Used to index columns that would otherwise not have indexes. Not actually used for uniqueness. |
...