[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/27/2009 at 04:37AM PDT, ID: 24846817 | Points: 500
[x]
Attachment Details

Hibernate query problem

Asked by RealWorld in Java Programming Language, J2EE Frameworks

Tags: hibernate, java

Hiya, I'm sort a newbie when it comes to hibernate so I'm going to try to ask my question as clearly as possible. I wanna execute following query as hibernate query . Now i is a dynamic value, so sometimes I'll pass 1 sometimes 1000, actually I'll iterate trough list and do the query for every item in the list, you get my point. Now here is my part of java calling execution of this query ..I already have created list of type Long and I get list items from another query , Is there something wrong with this approach ? thank you

Bottom line .. I  have to pass my list as an argument to the set parameter list
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
<sql-query name="updateINFO">
     	  update 
     	        info 
     	  set   
     	        status_id = 2 
     	  where 
     	        pid = (:in)   	
     </sql-query> 
 
 
 
for(int i=0; i<list.size(); i++)
     {
         Query query = session.getNamedQuery("updateINFO").setParameter("in", list.get(i));
     }
 
 
 
  List<Long> list = null;
    Query query = session.getNamedQuery("endDateChecker");
    list = query.list();
[+][-]10/27/09 04:43 AM, ID: 25671205

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 04:45 AM, ID: 25671225

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 04:48 AM, ID: 25671253

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/27/09 05:30 AM, ID: 25671625

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625