public User loadByUserName(String userName) {
if(userName == null || userName.trim().equals("")) return null;
Query q = getEntityManager().createQuery("select u from User u where u.login = :userName").setParameter("userName", userName);
User u = null;
try {
u = (User) q.getSingleResult();
} catch (NoResultException e) {
//nop