1
String hql = "select password from User where username=?";
List<String> lst = hibernateTemplate.find(hql, user.getUsername());
2
template.bulkUpdate("delete from Directory where user=? and parentPath like ?", new Object[]{userInfo.getCookieUser(), path + "%"});
使用 bulkUpdate进行批量 更新,两个参数代表用?预定义
3
多参数hql查询
template
.findByNamedParam(
"from File where user = :user and path = :path order by uploadTime",
new String[]
{ "user", "path" }, new Object[]
{ username, path });