//根据parentId查找属于parentId的typeLevel的最大值
public String findTypeLevelByParentId(int parentId) {
Session session = getHibernateTemplate().getSessionFactory().openSession();
return (String) session.createQuery("select max(blogType.typeLevel) from BlogType blogType where blogType.parentId=?").setInteger(0, parentId).uniqueResult();
};
public String findTypeLevelByParentId(int parentId) {
Session session = getHibernateTemplate().getSessionFactory().openSession();
return (String) session.createQuery("select max(blogType.typeLevel) from BlogType blogType where blogType.parentId=?").setInteger(0, parentId).uniqueResult();
};
解决方案 »
- 有谁用struts2在resin上过的
- JQuery拖拽效果树
- 关于整合Tomcat和apahce的问题
- javascript中函数如何执行一个链接?
- WebSphere 中jsp调试问题,急,在线等 100 分
- webwork 翻页该如何实现比较合理?希望能给出代码参考一下.
- 一个简单问题!
- 高手低手赏脸帮个小忙,谢谢了
- 我想做一个类似QQ的聊天工具 其中账户注册后 用XML保存在节点当中,但是具体不知道怎么做?有谁可以教教我吗
- 来帮帮忙啊,我的tomcat为什么不启动啊?在线等待··············
- request.getParameter()获取不了值
- 有人用过weblogic的WLST吗,求入门指导
你为什么把max返回的数值型数据转换成字符串
session 是不是可以设置成自动关闭的 !
直接把SQL语句到数据库跑下,然后测试下就知道了。
后者不用关闭