i use a HQL like this:
"from Post as post inner join fetch post.thread , post.thread.forum"
in my opion , it will return an object instance of Post , am i right?
but when i do this, java.lang.ClassCastException is thrown
Code:
Collection result = testquery.list();
logger.debug("get test post list result is " + result);
Iterator resultIter = result.iterator();
while(resultIter.hasNext())
{
Post post = (Post)resultIter.next();
logger.debug("get post is " + post + " with forum is :" + post.getThread().getForum());
}
what's the problem with me?