67,512
社区成员
发帖
与我相关
我的任务
分享
Could not open Hibernate Session for transaction
org.springframework.dao.DataIntegrityViolationException: could not execute query; SQL [select to_char(apply_time,'yyyy-mm') as time,sum(approve_quota) as total from APPLY_INFO group by to_char(apply_time,'yyyy-mm') order by to_char(apply_time,'yyyy-mm');]; nested exception is org.hibernate.exception.DataException: could not execute query
public List nonPerforming() {
return getHibernateTemplate().execute(
new HibernateCallback<List>() {
@Override
public List doInHibernate(Session session)
throws HibernateException, SQLException {
SQLQuery query = session
.createSQLQuery("select to_char(apply_time,'yyyy-mm') as time," +
"sum(approve_quota) as total from APPLY_INFO " +
"group by to_char(apply_time,'yyyy-mm') " +
"order by to_char(apply_time,'yyyy-mm');");
List results = query.list();
return results;
}
});
}