Complete and Categorized JPA Notes with Detailed Explanation and Code Examples

Complete and Categorized JPA Notes with Detailed Explanation and Code Examples

🧩 1. Overview of JPA 🏷️ 2. Entity Annotations Annotation Purpose @Entity Marks a class as a JPA entity @Table(name = “table_name”) Optional table name @Id Primary key @GeneratedValue(strategy = GenerationType.AUTO) Auto generation of primary key @Column(name = “col_name”) Customize column mapping @Transient Field not persisted @Lob For large binary/text…