Skip to content

Add support for Hibernate's hibernate.hbm2ddl.extra_physical_table_types #47921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Chu3laMan
Copy link

@Chu3laMan Chu3laMan commented May 17, 2025

This MR adds support for configuring additional database object types to be included
in schema management operations, such as materialized views or other database-specific objects.

Changes:

  1. Add documentation for the existing extraPhysicalTableTypes() method
  2. Pass the configuration to Hibernate ORM in FastBootHibernatePersistenceProvider
  3. Add the same implementation for Hibernate Reactive in FastBootHibernateReactivePersistenceProvider
  4. Define a constant for the setting if not already available in Hibernate's AvailableSettings

Example usage: quarkus.hibernate-orm.extra-physical-table-types=MATERIALIZED VIEW,VIEW

@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive labels May 17, 2025
Copy link

quarkus-bot bot commented May 17, 2025

/cc @gsmet (hibernate-orm)

@geoand geoand requested review from marko-bekhta and yrodiere May 19, 2025 08:27
@geoand geoand changed the title Feature/47854 add a supported configuration property Add support for Hibernate's hibernate.hbm2ddl.extra_physical_table_types May 19, 2025
Copy link
Contributor

@marko-bekhta marko-bekhta left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the pull request!

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. It looks good overall; I added a few minor comments below.

We'll need a test, though. But it can be very simple, see #47854 (comment)

@Chu3laMan
Copy link
Author

@yrodiere would you check now?

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

I added two comments, though they're mostly the same as on the previous review :)

Also, did you see my answer to your question "how can I test this"? There is a suggestion for a simple way of testing your change.

@Chu3laMan
Copy link
Author

@yrodiere sorry for being late, already added what you aforementioned above

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Thanks. The implementation looks good, but as I commented below I think the test will fail -- let's try though :)

This comment has been minimized.

This comment has been minimized.

Copy link

github-actions bot commented May 28, 2025

🎊 PR Preview b57f54e has been successfully built and deployed to https://quarkus-pr-main-47921-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@yrodiere
Copy link
Member

@Chu3laMan it seems your code contains formatting/import issues. Please have a look at https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#ide-config-and-code-style
Quick fix: run ./mvnw process-sources then amend your commit and push.

Please also see my other comment though; I expect tests will fail.

Comment on lines 59 to 60
overrideConfigKey("quarkus.hibernate-orm.\"overridesPU\".database.extra-physical-table-types",
"MATERIALIZED VIEW,FOREIGN TABLE");
Copy link
Member

Choose a reason for hiding this comment

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

This should not be in this method, but next to the other calls to overrideConfigKey higher up in this file.

Copy link
Author

Choose a reason for hiding this comment

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

@yrodiere I already fixed could you check again

Copy link
Member

Choose a reason for hiding this comment

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

You removed the call to overrideConfigKey, but didn't add it higher up in this file... ?
As is, the test will just fail.
Can you please fix this and rebase?

This comment has been minimized.

This comment has been minimized.

Copy link

quarkus-bot bot commented Jun 24, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 0155059.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Initial JDK 17 Build Build Failures Logs Raw logs 🔍

You can consult the Develocity build scans.

Failures

⚙️ Initial JDK 17 Build #

- Failing: extensions/hibernate-orm/deployment 
! Skipped: docs extensions/flyway/deployment extensions/hibernate-envers/deployment and 97 more

📦 extensions/hibernate-orm/deployment

Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.26.0:validate (default) on project quarkus-hibernate-orm-deployment: File '/home/runner/_work/quarkus/quarkus/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/config/properties/ConfigPropertiesTest.java' has not been previously formatted. Please format file (for example by invoking `mvn -f extensions/hibernate-orm/deployment net.revelc.code.formatter:formatter-maven-plugin:2.26.0:format`) and commit before running validation!

Copy link

quarkus-bot bot commented Jun 24, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 0155059.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a supported configuration property "hibernate.hbm2ddl.extra_physical_table_types"
3 participants