Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a native SQL subquery within a HQL query?

I would want to create a HQL query with a native SQL subquery. It's possible to use a HQL subquery within a HQL query but what about a native SQL subquery within a HQl query ? Cause, in hibernate, we use session.createQuery to create a HQL query and session.createSQLQuery to create a native SQL query.

like image 932
user3490028 Avatar asked Jun 05 '26 03:06

user3490028


1 Answers

There is no way to mix both HQL and SQL. You can't. Execute them separately and use it with one another. That is the only way.

like image 176
Suresh Atta Avatar answered Jun 07 '26 15:06

Suresh Atta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!