These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: where clause in slect stmt
PostPosted: Mon Jul 11, 2011 3:58 pm 
Newbie

Joined: Thu Jun 09, 2011 3:37 pm
Posts: 9
Hi there, I am using a condition in where clause I am gettinng 4 records size is showing correct but data is showing same for all 4 records.

System.out.println("Retrieving Record");
TblStratificationValue stratvalue = new TblStratificationValue();
org.hibernate.Query query = session.createQuery("from TblStratificationValue where StratificationTypeId =4");
// org.hibernate.Query query = session.createQuery("from TblStratificationValue");
// System.out.println("StratificationTypeID--------------------------"+this.StratificationTypeId);

// query.setString("stratId",this.StratificationTypeId);
// query.setString("stratId","3");
System.out.println("Query^^^^^^^^"+query.getQueryString());
System.out.println("Query Size"+ query.list().size());
list = (ArrayList) query.list();
//Order o=(Order)list.iterator.next();
Iterator i = list.iterator();

while(i.hasNext())
{
System.out.println("%9999999****************************************************************######");
stratvalue = (TblStratificationValue)i.next();
System.out.println("stratvalue = "+stratvalue);
list.add(stratvalue);//.getStatusId(),status.getStatus());
System.out.println("getStratificationValueId():-"+stratvalue.getStratificationValueId());
System.out.println("getStratificationValueId():-"+stratvalue.getName());
System.out.println("size%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%:-"+list.size());

}

session.getTransaction();
this is my code please give me a hint why is it showing same values for name and values.
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.