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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:32:25+00:00 2026-05-25T01:32:25+00:00

Hi I have a hibernate query which is giving me a list with type

  • 0

Hi I have a hibernate query which is giving me a list with type List<List<integer>>.
How can I iterate this? My hibernate query is:

String SQL_QUERY = "select DISTINCT cbl.franchiseId,cbl.resellerId from 
     CustomerBusinessLocation cbl where cbl.cmcustLocId in (:locationId)";

Query query = getSession().createQuery(SQL_QUERY); 

query.setParameterList("locationId", customerLocId);

List<List<Integer>> rc_list = query.list();

Alternatively, is there any other way to easily pull in this data?

  • 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-25T01:32:26+00:00Added an answer on May 25, 2026 at 1:32 am

    This query doesn’t return a List<List<Integer>>. It returns a List<Object[]>. The Object[] arrays contain one element per requested field. In your case, each Object[] will contain franchiseId at index 0 and resellerId at index 1.

    This is of course explained in the reference documentation.

    The iteration should thus look like this:

    List<Object[]> rows = query.list();
    for (Object[] row : rows) {
        Integer franchiseId = (Integer) row[0];
        Integer resellerId = (Integer) row[1];
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Hibernate and I have this query: List<Person> list = sess.createQuery(from Person).list();
I have an NHibernate query that looks like this: var query = Session.CreateQuery(@ select
I have a simple query which get a list of all dates in a
I have an entity (JPA annotations with Hibernate query interface) which has a composite
I have the following HQL query which works fine, however it returns a list
I have the following HQL( The Hibernate Query Language ) query (which is executed
I have a Query in hibernate which I believe is because of the VARCHAR
I get object from hibernate query. Then i have list of fields, whose getters
I'm having a Hibernate query problem, basically it goes like this ... I have
I have a SQL SELECT query which has a LIKE clause containing an underscore,

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.