Hibernate in Spring Boot
🔑 Hibernate / JPA Annotations Cheat Sheet AnnotationPurpose@EntityMarks a class as a persistent entity (mapped to a table).@Table(name = "...")Customizes the table name.@IdMarks the primary key field.@GeneratedValue(strategy = ...)Specifies primary key generation strategy. Common for Postgres: GenerationType.IDENTITY or GenerationType.SEQUENCE.@ColumnCustomizes a column (name, nullable, length, unique, etc.).@ManyToOneDefines a many-to-one relationship (foreign key).@OneToManyDefines a one-to-many relationship…
