List<BOUser> lstUsers = query.list();
if(lstUsers != null && lstUsers.size() > 0) {
user = lstUsers.get(0);
}
} catch (Exception a_th) {
throw new GenericException("Database problem", a_th, GenericException.Type.Database);
} finally {
close(sessionFactory, session);
}
return user;
}