aspose file tools*
The moose likes Object Relational Mapping and the fly likes HQL converting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HQL converting problem" Watch "HQL converting problem" New topic
Author

HQL converting problem

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
this is my main class


this is Eror


I tried changing 24 line by Integer[] row = (Integer[]) itor.next();
it also give Eooror

Victor Dolirio
Ranch Hand

Joined: Aug 21, 2008
Posts: 57
Hello Samanthi,

In your hql, you're projecting the ID of the person. This ID is a value of type Integer, just how you mapped that. So you MUST to get it with a variable of Integer type and not an array. Try this on line 23:


If happen something bad in you life, don't ask God why it happened. Ask for what.
SCJP 5 (80%) - SCWCD 5 (91%) - SCBCD & SCJD coming soon...
Charan kumar sarvepalli
Ranch Hand

Joined: Dec 14, 2008
Posts: 40
Hi,

In your HQL in select clause you have only one column defined to return, so the hibernate returns object only.
if you have defined multiple columns in the select clause then definitely it returns object[].


-- Charan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HQL converting problem