Hi
I have found a peculiar thing in Hibernate :
Session.createCriteria(Class persistentClass) doesn't throw any exception even if class is not loaded in the Session through mappings file.
e.g.
Code:
List<TempVO> cbdList = new ArrayList<TempVO>();
String cbd = null;
Session session = null;
try {
session = HibernateUtil.currentSession();
Criteria currentCriteria = session
.createCriteria(TempVO.class);
currentCriteria.add(Restrictions.eq("is_current", 'Y'));
cbdList = currentCriteria.list();
returns blank list even though TempVO class is not specified in mapping.hbm.xml
Is there any way we can capture this type of error?