liudan wrote:
But I get nothing returned, I guess it's because i close the session. I don't know when would be the best time to close a session and how to detach a object/collection. can someone help me ?
liudan, everything is fine with session closing, the same approach works for me and collection returned by query.list() does not expire after session.close(). Check yor query: look into the hibernate debug level log, copy SQL query for your HQL one, repalce all ? with the corresponding values and execute this SQL query using your SQL tool, I guess it returns nothing.
Leonid