Skip to content

Conversation

@robwgreenjr
Copy link

https://hibernate.atlassian.net/browse/HHH-19056


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


Comment on lines 135 to 138
Object context = generationContextLocator.locateGenerationContext( session, object );
if ( context == null ) {
context = getDefaultSupplier( compositeType.getReturnedClass() ).get();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using getDefaultSupplier here is not correct, we should rather retrieve the embedded identifier's EmbeddableRepresentationStrategy. You should be able to retrieve it from the entity persister, by looking at its identifier attribute - we should also check we're in this "special" mapsid with null embedded id case.

I would also keep this logic under generationContextLocator.locateGenerationContext, but that's just a detail.

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Oct 8, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants