2

I am having problem with named query parameter. My query is as follow:

<sql-query name="getCustomer">
<![CDATA[
     select * from customer where customerId=:custId and billId in ( :billIdList )
]]>
</sql-query>

I am setting all parameters, but having problem in :billIdList whenever I am setting this parameter I am getting a Empty list of customers. My :billIdList is in the string form e.g: 5,6,7,9. There is data in DB also with above values. It works fine when I am writing query in program it self.

Please help me.

1 Answer 1

1

For parameters with more than one value you need to use a setParameterList() method of Hibernate's Query interface:

query.setParameterList("billIdList", new int[] {5,6,7,9});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.