return user;
}
public User getUserByLoginOrEmail(final String usernameOrEmail, Object... params) {
Criteria criteria = createDefaultCriteria(User.class);
FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);
criteria.add(Restrictions.or(Restrictions.eq("login", usernameOrEmail), Restrictions.eq("email", usernameOrEmail)));
criteria.add(Restrictions.eq("active", true));
User user = (User) criteria.uniqueResult();
if(user != null){
user.setFetchPlan(fetchPlan);