Files
main/awesome-cursor-rules-mdc/java-springboot-jpa-cursorrules-prompt-file/entity-class-conventions.mdc
T
2025-02-17 17:50:15 +05:30

9 lines
643 B
Plaintext

---
description: Sets the standards for entity class design including annotations, ID generation strategies, and relationship configurations for database interaction.
globs: **/src/main/java/com/example/entities/*.java
---
- Must annotate entity classes with @Entity.
- Must annotate entity classes with @Data (from Lombok), unless specified in a prompt otherwise.
- Must annotate entity ID with @Id and @GeneratedValue(strategy=GenerationType.IDENTITY).
- Must use FetchType.LAZY for relationships, unless specified in a prompt otherwise.
- Annotate entity properties properly according to best practices, e.g., @Size, @NotEmpty, @Email, etc.