Skip to content
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

Dedicated Dev UI interface to execute HQL (Hibernate ORM) queries #46728

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

mbladel
Copy link
Member

@mbladel mbladel commented Mar 11, 2025

Fixes #39584, allowing execution of arbitrary HQL queries in the current Hibernate ORM context.

HQL_demo

The UI is very similar to the existing Agroal (SQL) database view (many thanks to @phillip-kruger for the inspiration 🙏) but allows selecting Hibernate persistence units and their entities, displaying existing data and executing custom HQL queries.

Data is rendered using native marshalling for now; this is ok for basic result types or simple entities, but it will not do for more complex models (e.g. circular associations, laziness, et.al.). I'm also working on a custom Hibernate tool that allows transforming query results to a textual (JSON) format and account for these complexities - I will update this interface to use that once it's available.

@mbladel mbladel added the area/hibernate-orm Hibernate ORM label Mar 11, 2025
Copy link

quarkus-bot bot commented Mar 11, 2025

/cc @gsmet (hibernate-orm)

This comment has been minimized.

Copy link

github-actions bot commented Mar 11, 2025

🎊 PR Preview 13ccd68 has been successfully built and deployed to https://quarkus-pr-main-46728-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.

This comment has been minimized.

@phillip-kruger
Copy link
Member

I like the input at the top. I think we should change the JDBC one to work/look the same

@yrodiere
Copy link
Member

yrodiere commented Mar 12, 2025

I like the input at the top. I think we should change the JDBC one to work/look the same

+1. Also, I was wondering if these consoles would be worth a direct link in the "main menu" on the left? Is that possible @phillip-kruger ?

@phillip-kruger
Copy link
Member

phillip-kruger commented Mar 12, 2025

@yrodiere any link on a card can be dragged to the menu and then it will be there as a shortcut

@yrodiere
Copy link
Member

@yrodiere any link on a card can be dragged to the menu and then it will be there as a shortcut

Wow, that's convenient.

But I meant as a default, to ensure the consoles are more visible. I suspect most people won't care at all about the list of entities, but they will very much care about SQL/HQL consoles, so we probably want all developers to be aware these consoles exist.

@phillip-kruger
Copy link
Member

Yes you can also add that there always. Rather than a Card builder you will use a Menu Builder. The rest is the same
See https://quarkus.io/guides/dev-ui#add-a-section-menu

@yrodiere
Copy link
Member

Yes you can also add that there always. Rather than a Card builder you will use a Menu Builder. The rest is the same See https://quarkus.io/guides/dev-ui#add-a-section-menu

Created #46759

@yrodiere
Copy link
Member

Also created #46760 to address the inconsistent structure of Hibernate Dev UI (which is a pre-existing problem I think, so not strictly related to this PR)

@mbladel
Copy link
Member Author

mbladel commented Mar 12, 2025

Also created #46760 to address the inconsistent structure of Hibernate Dev UI (which is a pre-existing problem I think, so not strictly related to this PR)

If we want this to be consistent with the existing Hibernate ORM views, i.e. persistence unit selection in a tabsheet instead of a combo box, that's a pretty easy change. I felt the drop-down would be a bit nicer / less intrusive, but I don't have a strong opinion on it.

@yrodiere
Copy link
Member

Also created #46760 to address the inconsistent structure of Hibernate Dev UI (which is a pre-existing problem I think, so not strictly related to this PR)

If we want this to be consistent with the existing Hibernate ORM views, i.e. persistence unit selection in a tabsheet instead of a combo box, that's a pretty easy change. I felt the drop-down would be a bit nicer / less intrusive, but I don't have a strong opinion on it.

Yes I also think your solution is better, that's why I'd rather we merge it and fix the consistency later :)

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.

It sure looks great! Thank you.

I have a few security concerns, and added a few more minor remarks. See below.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@yrodiere
Copy link
Member

Just so you know @mbladel the flaky test above is unrelated (though it's causing me much despair); see #42479

@mbladel
Copy link
Member Author

mbladel commented Mar 14, 2025

@yrodiere thanks for the heads up, I did see that test failing enough times to guess it was just flaky. I might try to reproduce it as well, though seeing your several attempts without much success doesn't give me much hope 😅

@yrodiere
Copy link
Member

@yrodiere thanks for the heads up, I did see that test failing enough times to guess it was just flaky. I might try to reproduce it as well, though seeing your several attempts without much success doesn't give me much hope 😅

Yeah I'll gladly let someone else take that one, but if you do, be warned it might take a few days...

This comment has been minimized.

This comment has been minimized.

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.

Thank you! LGTM, we can merge any time you want IMO.

I have a suggestion for error handling, but I'll let you judge if it's necessary.

Maybe @phillip-kruger will want to have a look at the serialization part, too.

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

LGTM

@yrodiere yrodiere added triage/waiting-for-ci Ready to merge when CI successfully finishes release/noteworthy-feature labels Mar 19, 2025
Copy link

quarkus-bot bot commented Mar 19, 2025

Status for workflow Quarkus Documentation CI

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

✅ 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.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

quarkus-bot bot commented Mar 19, 2025

Status for workflow Quarkus CI

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

✅ 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.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni - History

  • Stream has no elements - java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Stream has no elements
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lambda$lastReading$2(MetricDataFilter.java:213)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReading(MetricDataFilter.java:213)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:231)
	at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni(MicrometerTimedInterceptorTest.java:174)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:521)

@yrodiere yrodiere merged commit 7960d59 into quarkusio:main Mar 19, 2025
58 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Mar 19, 2025
@quarkus-bot quarkus-bot bot added this to the 3.22 - main milestone Mar 19, 2025
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Mar 19, 2025
@mbladel mbladel deleted the hibernate-dev-ui branch March 19, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dedicated Dev UI interface to execute (and "log"?) Hibernate ORM queries
4 participants