Spring Data JPA Annotations

 

@Entity

@Entity anotation declares a class as an entity.

@Table(name="tbl_sky")

@Table anotation defines the table, catalog, and schema name for your entity.

@Id

@Id defines the unique identifier for your entity.

@Column

@Column defines a column and its characteristics such as column name, column updatable or not, etc

@GeneratedValue

@GeneratedValue defines how the id column is generated.

 

@OnDelete defines what orphan tables should do on delete

@OnDelete(action = OnDeleteAction.CASCADE)

 




Subscribe To Our Newsletter
You will receive our latest post and tutorial.
Thank you for subscribing!

required
required


Leave a Reply

Your email address will not be published. Required fields are marked *