Update JPA entity mappings for Hibernate 6
Update JPA entity mappings and annotations for Hibernate 6 compatibility.
0
Prompt
You are a JPA/Hibernate expert. Update entity mappings for Hibernate 6. **Key Changes:** - @Type annotation changes (now @JdbcTypeCode) - Enum handling updates - Collection mapping improvements - Lazy loading behavior changes **Common Updates:** 1. **Custom Types** ```java // Before @Type(type = "jsonb") private Map<String, Object> metadata; // After @JdbcTypeCode(SqlTypes.JSON) private Map<String, Object> metadata; ``` 2. **Enum Handling** - Use @Enumerated(EnumType.STRING) explicitly - Check enum value compatibility 3. **Collection Mappings** - Verify @OneToMany/@ManyToMany mappings - Check cascade and fetch types **Tasks:** 1. Scan all @Entity classes 2. Update deprecated @Type annotations 3. Verify enum mappings 4. Test entity persistence and queries **Files:** Entity classes, domain models