final String fpermitId = permitId;
this.getHibernateTemplate().execute(new HibernateCallback() {
@Override
public Object doInHibernate(Session session) throws HibernateException,
SQLException {
// TODO Auto-generated method stub
StringBuilder queryString = new StringBuilder();
queryString.append(" select * from daul where xxx=?");
SQLQuery sqlQuery = session.createSQLQuery(queryString.toString());
sqlQuery.setString(0, fpermitId);
sqlQuery.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
return sqlQuery.list();
}
});
其他方法调用上面返回的结果Object
List rList = (List) rObj;
if(null!=rList&&rList.size()>0){
Map<String,Object> rMap = (Map<String,Object>) rList.get(0);
sendNodeType = (String) rMap.get("SENDNODETYPE");
}