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

The Archive Base Latest Questions

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

I have a queryString along the lines of: session.createSQLQuery(SELECT C.FIRSTNAME AS firstName, C.LASTNAME as

  • 0

I have a queryString along the lines of:

session.createSQLQuery("SELECT C.FIRSTNAME AS firstName, C.LASTNAME as lastName FROM ADDRESSBOOK_CONTACT AS C WHERE C.ADDRESSBOOK_ID = :addressbookId AND firstName = ?");

When setting my positional parameter, the query is run as normal but there is no result:

query.setParameter(0, "firstname1010");
query.setParameter("addressbookId", addressbook.getId());

Which is wrong. If I change my positional to named:

query.setParameter(firstname, "firstname1010");

Then my query returns the correct results.

Without going into a convoluted explanation as to why I am doing this, I would like to know if mixing the two types should be supported or not? I am using hibernate 3.6.3.Final

  • 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-06T20:52:26+00:00Added an answer on June 6, 2026 at 8:52 pm

    From the Class level docs on org.hibernate.Query:

    You may not mix and match JDBC-style parameters and named parameters
    in the same query.

    So the behaviour you’re seeing is completely expected.

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

Sidebar

Related Questions

I have a database connection which takes an input from the querystring to access
Greetings, I have a servlet which pulls an action parameter from a querystring. Based
I have startdate in QueryString with value: 3/1/2012 DateTime.Parse(Request.QueryString[startdate]).Month return month number: 1 but
I have web page which is passing a querystring parameter to page 2: <a
I have a page request with a QueryString, say http://www.xyz.net/Orders.aspx?OrderID=1 . The page is
I have an action method without parameters. The QueryString collection contain all of my
how can i use request.querystring in asp.net.i have a linkbutton and this is in
If I have a query like this: String Category = HttpContext.Current.Request.QueryString[Product].ToString(); IQueryable<ItemFile> pressReleases =
In researching how to convert a NameValueCollection to a querystring, I have come across
I have a question about the returnUrl querystring parameter that is appended by ASP.Net

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.