hello
Code:
public Employee getByUserName(String username) {
return (Employee) getHibernateTemplate().find(
"FROM Employee WHERE username = ?", username).get(0);
}
try in this way
Code:
public Employee getByUserName(String username) {
Employee employee = (Employee) getHibernateTemplate().find(
"FROM Employee WHERE username = ?", username).get(0);
getHibernateTemplate().initialize(employee);
return employee;
}
But I will repete "Sometimes, the following lines: Set<SubMenu> subMenus = employee.getSubMenu(); throws the popular "LazyInitializationException""
yes, you right, sometimes, and i cant explain the reason of that
but i know how avoid the "LazyInitializationException"
So, it looks like is effect of Ajax Framework.
i dont think so, i used to work with ajax, but tell me how you use ajax with the Set variable?
regards