public Role getRole(long id) {
return (Role) getHibernateTemplate().get(Role.class, id);
}
public Role getRole(String roleName) {
Role r = null;
if (roleName != null) {
List list = getHibernateTemplate().find("from Role r where r.name=?", roleName);
if (list != null && !list.isEmpty()) r = (Role) list.get(0);
}
return r;