KamoCRM

Switch MediaObjTransit to @MapsId derived-identity pattern

Fixkamo-shared-library
Shipped
1 மே, 2026 அன்று 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.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing