/**
 * 
 */
package com.min.vacation.business.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.springframework.stereotype.Repository;

import com.min.vacation.business.dao.UserDao;
import com.min.vacation.business.model.User;

/**
 * The UserDaoImpl class.
 * 
 * @author wpetit
 */
@Repository
public class UserDaoImpl implements UserDao {

    /** The entityManager. */
    @PersistenceContext
    private EntityManager entityManager;

    /** {@inheritDoc} */
    @Override
    public void save(final User user) {
        entityManager.persist(user);
    }

    /** {@inheritDoc} */
    @Override
    public User getUserByUsername(final String username) {
        User result = null;
        try {
            TypedQuery<User> query = entityManager.createQuery(
                    "select u from User u where username=:username", User.class);
            query.setParameter("username", username);
            result = query.getSingleResult();
        } catch (NoResultException e) {
            result = null;
        }
        return result;
    }
}

@@ -223,24 +223,83 @@
 edQuery;%0D%0A%0D%0A
+import org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A
 import org.s
@@ -553,24 +553,144 @@
 serDao %7B%0D%0A%0D%0A
+    /** The LOG. */%0D%0A    private static final Logger LOG = LoggerFactory%0D%0A            .getLogger(UserDaoImpl.class);%0D%0A%0D%0A
     /** The 
@@ -1101,16 +1101,38 @@
 yManager
+%0D%0A                    
 .createQ
@@ -1138,16 +1138,24 @@
 Query(%0D%0A
+        
         
@@ -1214,16 +1214,45 @@
 ername%22,
+%0D%0A                           
  User.cl
@@ -1397,24 +1397,94 @@
 ption e) %7B%0D%0A
+            LOG.info(%22No user found for username : %22 + username, e);%0D%0A
             

Add logs