Hello List;

I'm trying to implement the scenario explained at this site: http://www.devx.com/Java/Article/30396/1763

At some place in the code,  there is such code below(In AbstractGeneriDao, in generate member method ):

------------------------------
------------------
(SessionImpl)getSession();
------------------------------------------------

Notes:
SessionImpl : org.hibernate.impl.SessionImpl
getSession : org.hibernate.classic.Session


I looked that SessionImpl class implements org.hibernate.classic.Session interface, therefore the casting should work.
But when i run the application, there occure cast exception which says that
Cannot cast org.hibernate.classic.Session to org.hibernate.impl.SessionImpl.


Why this casting not working I could not understand. I think It should work, because i am making a casting operation from an interface to its implementation class.

Does anybody know why it does not work?

Regards,


-Halil AGIN