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 8117187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:04:52+00:00 2026-06-06T04:04:52+00:00

After upgrading to a newer hibernate version (guess it came with the switch from

  • 0

After upgrading to a newer hibernate version (guess it came with the switch from JBoss 4.2.2 to JBoss 6), some queries fail with the message:


Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName= (...)

This is always the case when using a query like this:

SELECT entityA FROM EntityA entityA 
JOIN FETCH entityA.entityB
LEFT JOIN FETCH entityA.entityB.someField
WHERE entityA.entityB.anotherField LIKE :someParameter

The solution to the problem is to give “entityA.entityB” an alias and then to use this alias in the WHERE clause. But in some queries the LEFT JOIN FETCH is not explicitely given but still the WHERE clause uses the property of a referenced entity. Will it also fail there? What has changed, so that it suddenly fails after switching to a new JBoss version?

The following question is related to this question and includes the solution, but doesn’t explain the problem.

  • 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-06T04:04:54+00:00Added an answer on June 6, 2026 at 4:04 am

    The query should be

    SELECT entityA FROM EntityA entityA 
    JOIN FETCH entityA.entityB entityB
    LEFT JOIN FETCH entityB.someField
    WHERE entityB.anotherField LIKE :someParameter
    

    I.e. you should assign an alias to each joined entity, and use this alias for subsequent joins or restrictions.

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

Sidebar

Related Questions

After upgrading from Spring 3.0.0.M4 to 3.0.0.RC1 and Spring Security 3.0.0.M2 to 3.0.0.RC1, I've
I noticed after upgrading from 4.2 to 4.3.1 that there is no longer a
We've recently upgraded from Oracle 10 to Oracle 11.2. After upgrading, I started seeing
After upgrading from Cake 1.3 to 2.0 I I'm getting missing table errors for
After upgrading to Ruby 1.9.3 (from 1.9.2 using system RVM) on Ubuntu 10.04.3, I
after upgrading to latest version of eclipse Helios 3.6 , M2E 1.0 , WTP
After upgrading from TFS 2008 to 2010 and running crazy having the build to
After upgrading from EF 4.2 and Migration to EF 4.3 and enabling migration,restarting Visual
After upgrading to Magento 1.6.2.0 (from 1.4) the product_option field in table sales_flat_order_item doesn’t
After upgrading magento from 1.4.0.1 to 1.5.1.0 , i'm not able to submit an

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.