Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in getting result when fire distinct query in JPA

 
akhtar qureshi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am fire my JPA query

Query query = "SELECT DISTINCT o.partnumber from assembly o where o.modiNum =:modiNum";
Collection<Object> coll = query.executeQuery();

till now going fine...but

when i iterate the list data it gives me error when i casting....

iterator itr = coll.Iterator();

while(itr.hasNext())
{
String val = (String)itr.next(); /// from Here its give me Error

}


can you please tell me its return single column base data or return the whole row as my entity,,,


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error do you see?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic