Skip to content

HHH-20321 Schema actions skipped when Metadata has no contributors#12139

Open
lucamolteni wants to merge 1 commit intohibernate:mainfrom
lucamolteni:HHH-20321-main
Open

HHH-20321 Schema actions skipped when Metadata has no contributors#12139
lucamolteni wants to merge 1 commit intohibernate:mainfrom
lucamolteni:HHH-20321-main

Conversation

@lucamolteni
Copy link
Copy Markdown
Member

@lucamolteni lucamolteni commented Apr 8, 2026

Summary

Forward-port of #12138 to main.

When Metadata.getContributors() returns an empty set (e.g. no @Entity classes, only StatelessSession with native queries), SchemaManagementToolCoordinator skips all configured schema actions including import.sql execution.

The fix defaults to the "orm" contributor when the contributors set is empty, so the existing loop processes configured actions normally.

See also: quarkusio/quarkus#53413

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


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.


Please make sure that the following tasks are completed:
Tasks specific to HHH-20321 (New Feature):

  • Add tests for feature/improvement
  • Update documentation as relevant: javadoc for changed API, documentation/src/main/asciidoc/userguide for all features, documentation/src/main/asciidoc/introduction for main features, links from existing documentation
  • Add entries as relevant to migration-guide.adoc (breaking changes) and whats-new.adoc (new features/improvements)

@hibernate-github-bot
Copy link
Copy Markdown

hibernate-github-bot bot commented Apr 8, 2026

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ The pull request description must contain the license agreement text.
    ↳ The description of this pull request must contain the following license agreement text:

----------------------
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.txt)
and can be relicensed under the terms of the [LGPL v2.1 license](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) in the future at the maintainers' discretion.
For more information on licensing, please check [here](https://github.com/hibernate/hibernate-orm/blob/main/CONTRIBUTING.md#legal).

----------------------

› This message was automatically generated.

@lucamolteni lucamolteni requested review from beikov and mbellade April 8, 2026 09:41
When Metadata.getContributors() returns an empty set (e.g. no @entity
classes), SchemaManagementToolCoordinator skips all configured schema
actions including import.sql execution. Default to the "orm" contributor
when the set is empty so that configured actions are still processed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

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.

3 participants