package <%= package.lower %>.<%= project.lower %>.dao;

import java.util.logging.Logger;
import static java.util.logging.Logger.getLogger;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import  java.util.List;
import <%= package.lower %>.<%= project.lower %>.entity.Fingerprint;
import org.demoiselle.jee.crud.AbstractDAO;


/**
 *
 * @author gladson
 */
public class FingerprintDAO extends AbstractDAO< Fingerprint, Long> {

    private static final Logger LOG = getLogger(FingerprintDAO.class.getName());

    /**
     *
     */
    @PersistenceContext(unitName = "<%= project.lower %>PU")
    protected EntityManager em;

    /**
     *
     * @return
     */
    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

        /**
     *
     * @param id
     * @return
     */
    public List<Fingerprint> findByUsuario(String id) {
        return em.createNamedQuery("Fingerprint.findByUsuario").setParameter("usuario", id).getResultList();
    }

    /**
     *
     * @param id
     * @return
     */
    public List<Fingerprint> findByCodigo(String id) {
        return em.createNamedQuery("Fingerprint.findByCodigo").setParameter("codigo", id).getResultList();
    }
}

@@ -787,20 +787,16 @@
  %7D%0A%0A
-    
     /**%0A
     
@@ -783,32 +783,32 @@
 %0A    %7D%0A%0A    /**%0A
+
      *%0A     * @p
@@ -881,20 +881,18 @@
 Usuario(
-Stri
+Lo
 ng id) %7B
@@ -920,45 +920,66 @@
 eate
-Named
 Query(%22
-Fingerprint.findByUsuario
+SELECT f FROM Fingerprint f WHERE f.usuarioId = :id
 %22).s
@@ -991,23 +991,18 @@
 ameter(%22
-usuario
+id
 %22, id).g
@@ -1045,33 +1045,34 @@
 *%0A     * @param 
-i
+co
 d%0A     * @return
@@ -1129,17 +1129,18 @@
 (String 
-i
+co
 d) %7B%0A   
@@ -1164,39 +1164,62 @@
 eate
-Named
 Query(%22
-Fingerprint.findByC
+SELECT f FROM Fingerprint f WHERE f.codigo = :c
 odig
@@ -1245,17 +1245,18 @@
 odigo%22, 
-i
+co
 d).getRe

Ajuste Fingerprint