- Shipped
- May 1, 2026 at 7:57 AM UTC
- Author
- Kamo
- Commit
- fc5ee35
@IdClass combined with @Id @OneToOne is not reliably supported in Hibernate 6 — JpaRepository<MediaObjTransit, UUID> initialization fails with "does not define an IdClass" even when the annotation is present. The canonical JPA pattern for derived identity is @MapsId: a basic @Id UUID field plus a @MapsId @OneToOne to the parent, sharing the same FK column. Hibernate populates the id automatically from obj.id on persist, callers don't need to set it, and Spring Data exposes it as a singular UUID @Id with no metamodel fuss. DB schema is unchanged (single OBJ_ID column). Also removes MediaObjTransitId, no longer needed.