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

  • Home
  • SEARCH
  • 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 7016135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:44:42+00:00 2026-05-27T22:44:42+00:00

I have a hibernate query with a nested select: ((EntityManager)Component.getInstance(entityManager)).createQuery(SELECT e FROM someEntity e

  • 0

I have a hibernate query with a nested select:

((EntityManager)Component.getInstance("entityManager")).createQuery("SELECT e FROM someEntity e " +
                "WHERE e.field1 = ?1 AND e.field2 IS NOT NULL AND " +
                "e.field3 IN " +
                "(SELECT t.field3 from otherEntity t " +
                "WHERE t.id.field4 = ?2 " +
                "AND t.field5 > 0 " +
                "AND t.field6 != 'SUBMITTED')")
                .setParameter(1, processor.ONE_PARAM)
                .setParameter(2, processor.OTHER_PARAM)
                                .getResultList();

If I run this query as is, I get no errors or warnings and no results(returns null). If I change the query by replacing the 2nd parameter with the hardcoded value I get the results I expect:

((EntityManager)Component.getInstance("entityManager")).createQuery("SELECT e FROM someEntity e " +
                "WHERE e.field1 = ?1 AND e.field2 IS NOT NULL AND " +
                "e.field3 IN " +
                "(SELECT t.field3 from otherEntity t " +
                "WHERE t.id.field4 = hardcoded_other_param " +
                "AND t.field5 > 0 " +
                "AND t.field6 != 'SUBMITTED')")
                .setParameter(1, processor.ONE_PARAM)
                                .getResultList();

The outer and nested query work separately and together correctly in Oracle. Do params not work in Hibernate nested selects or am I missing something?

I’m using hibernate 3.31 with JSF 1.2 and Seam 2.

  • 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-05-27T22:44:43+00:00Added an answer on May 27, 2026 at 10:44 pm

    Can you run the debugger and check what the query string looks looks like in each case? I’m thinking you may be missing a space or another character that you think you are including. I wouldn’t think that the nested select would be an issue.

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

Sidebar

Related Questions

I have this Hibernate code: Query q = session.createQuery(from MyTable where status = :status);
I have an NHibernate query that looks like this: var query = Session.CreateQuery(@ select
i have an error with my hibernate request Hibernate operation: could not execute query;
I have hibernate query as below: String mySql = SELECT S.col1, S.col2, T.col3, T.col4,
I have the following hibernate query - events = (List<Event>)session.createQuery( Event where eventName like
I get object from hibernate query. Then i have list of fields, whose getters
I have a problem with a query using hibernate. The entity class EntityClass has
I have a basic NHibernate.Linq query: var items = from item in session.Linq<ObjectType>() where
I have the following Nhibernate LINQ query: var query = from c in session.Query<Customer>()
simple question regarding HQL(Hibernate query language) so i have user class , that can

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.