This bug is only relevant with hibernate.create_empty_composites.enabled=true. To illustrate, suppose an entity has an optional many-to-one association with an entity that has a composite ID. After persisting an entity with a null many-to-one association, it will not be possible to load that entity using Session#get or Session#find. Session#get or Session#find incorrectly returns null because Hibernate resolves the associated (hydrated) null ID as an empty composite, then attempts to load the associated entity, which fails because there is no entity with null values for its composite ID. Hibernate logs a message like: 12:54:19,484 INFO DefaultLoadEventListener:129 - HHH000327: Error performing load command : org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.hibernate.test.component.empty.EmptyCompositeManyToOneTest$OtherEntity#OtherEntity {firstName='null', lastName='null', description='null'} ] |