日期:2014-05-19 浏览次数:20621 次
public User queryUserByName(String name) { int count = 0; String hql = " from User u where u.name = " + name; List<User> list = hibernateTemplate.find(hql); count = list.size(); if(1 == count) { user = (User)list.get(0); } return user; }