1.hibernate sql调试篇
//service层代码
@Override
public List<CodeArea> getCodeAreaInfo() throws Exception {
try {
Map<String,String> map = new HashMap<String,String>();
return basicDataDao.getCodeAreaInfo(map);
} catch (Exception e) {
throw e;
}
}
注:控制台无明显报错,此时查看e的类型即可获知异常类型。
2.在控制台显示sql语句
<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<span style="color:#FF0000;"><prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop></span>
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>