2.0.3
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
mysql3.1:
CastClassException
erpt:
I use
Code:
Workforce wf = (Workforce) s.load(Workforce.class, workforce_id);
I will get a CastClassException
If I use the code :
Code:
List list=s.find("from Workforce as w where w.work_id=?",workforce_id,Hibernate.STRING);
Workforce wf=(Workforce)list.get(0);
It will get the object?
Why? It there any different between the two method? THKS!