| name | jpa-conventions |
| description | JPA entity, repository and schema conventions for this project. Use when creating or changing entities, repositories or anything affecting the database schema. |
JPA conventions
Entities
- Class name
<Name>Model, table name tb_<plural> via @Table(name = ...).
- Mutable class with a no-arg constructor, getters and setters.
- Primary key is
UUID with @GeneratedValue(strategy = GenerationType.AUTO).
- Always declare
@Column explicitly with nullable and length,
because the schema is generated from the entity.
- Implement
Serializable.
Schema
Generated by Hibernate with ddl-auto: update. No migration tool.
update adds tables and columns but NEVER removes or renames — a renamed
field leaves the old column behind permanently. If a change would require
dropping a column, say so explicitly instead of generating a diverging schema.
Repositories
public interface BookRepository extends JpaRepository<BookModel, UUID> {}
Derived queries for simple cases. No @Query unless the derived method
name would be unreadable.