Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8521935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:58:00+00:00 2026-06-11T06:58:00+00:00

From Hibernate 3.6 documentation: You may supply extra join conditions using the HQL with

  • 0

From Hibernate 3.6 documentation:

You may supply extra join conditions using the HQL with keyword.

from Cat as cat
left join cat.kittens as kitten
    with kitten.bodyWeight > 10.0

This with clause allows to add a restriction on the JOIN condition (ON clause). Is there any such thing in JPQL?

When I run the following JPQL:

select c from ContainerDef c left join fetch c.displayState ds where c.id = 1 and ds.user.id = 2

The following SQL is generated:

select
        ...
    from
        CONTAINER_DEF containerd0_ 
    left outer join
        USER_CONTAINERDEF displaysta1_ 
            on containerd0_.CONTAINERDEF_ID=displaysta1_.CONTAINERDEF_ID 
    where
        containerd0_.CONTAINERDEF_ID=? 
        and displaysta1_.AUTHUSER_ID=?

What should really get generated is:

select
        ...
    from
        CONTAINER_DEF containerd0_ 
    left outer join
        USER_CONTAINERDEF displaysta1_ 
            on containerd0_.CONTAINERDEF_ID=displaysta1_.CONTAINERDEF_ID 
            and displaysta1_.AUTHUSER_ID=?
    where
        containerd0_.CONTAINERDEF_ID=? 

I am sure I’m missing the right JPQL clause for HQL’s with.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:58:01+00:00Added an answer on June 11, 2026 at 6:58 am

    No, there is no such a feature in JPQL. Support for joining with specific condition is mentioned in JPA 2.1 topic list:

    — support for outer joins with ON conditions;

    So maybe JPQL will have it in future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the processes of changing my DAO layer from using Hibernate API to
I am migrating my grails project from using Hibernate XML to just GORM defined
i am making a sample program in hibernate follow this tutorial: http://www.myeclipseide.com/documentation/quickstarts/hibernateintroduction/ using reverse
I am using hibernate-search-3.2.1.Final and would like to parse my input into shingles. From
i really can not find enough documentation on hibernate IN keyword, when applied on
i'm using hibernate to lazily retrieve content from a database. This content is then
I've recently updated from hibernate 3.3.1.GA to hibernate 3.5.0 and I'm having a lot
I'm currently migrating my project from Hibernate HBM Mappings to Annotations. Everything was easy
I'm trying to upgrade from Hibernate 3.6.5 to 4.0 (and from Spring 3.0.5 to
I'd like to use org.hibernate.tool.hbm2ddl.SchemaExport from hibernate-core 4.1.4 to generate/export a Sybase ASE 15.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.