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.  [ 2 posts ] 
Author Message
 Post subject: Gavin please help me out.........
PostPosted: Tue Jul 12, 2005 10:44 am 
Newbie

Joined: Mon May 09, 2005 1:32 am
Posts: 7
Location: Bangalore
Hi Gavin
Iam facing a problem please help me out.
Iam using WSAD and DB2.Iam configuring my WSAD to use the DB2 datasource.Iam specifing the jndi name in my hibernate util file and using org.hibernate.dialect.DB2Dialect.
I have tried both using createQuery and createcriteria .I am getting the list of employees for a given departmentid which iam sending .I should get DepartmentListDTo which should have different DepartmentDTo with different employee ids.I.e i shud get 6 different DeoartmnetDTos for a given deptid .Iam getting the size of the list as fine.but the list contains the same dtos i.e 6 same departmentDtos.why is it so.I executed the generated sql in the DB2 query analyzer and supplied the dept id I got what i wanted in the query analyser.
Iam doing someting like this.

List depts = hibernatesession.createCriteria(DepartmentDTo.class)
.add(Expression.eq("deptid"deptID)
.list();
iam supplying deptID.The list size returns 6 which is fine .but when i loop through the list i get the same DTOs same values of employees.
i.e.
Iterator iter = depts.iterator()
while(iter.hasNext()){
DepartmentDTO dept =(DepartmentDTO) iter.next();
system.out.println("Employe name" +dept.getEmpName());
}

I get teh same values for the getEmpName().Please help me why is it happening.I tried using even createQuery but same result>but on sqlserver database it worked fine.Please help me out.Eagerly awaiting for ur response.
Thanking in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 12, 2005 12:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Read the FAQ!


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

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.