Package com.evasion.plugin.common.dao

Source Code of com.evasion.plugin.common.dao.ParametreDaoImpl

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.plugin.common.dao;

import com.evasion.dao.api.AbstractJPAGenericDAO;
import com.evasion.entity.Parametre;
import javax.persistence.NoResultException;
import javax.persistence.Query;

/**
*
* @author sebastien
*/
public class ParametreDaoImpl extends AbstractJPAGenericDAO<Parametre, Long> {

    /**
     * Recherche un parametre à partir de son nom.
     * @param propertyName nom du parametre recherche.
     * @return objet parametre resultat de la recherche.
     */
    public Parametre findByPropertyName(final String propertyName) {
        Parametre result;
        Query query = (Query) getEntityManager().
                createNamedQuery(Parametre.FIND_PROPERTY);
        query.setParameter(1, propertyName);
        try {
            result = (Parametre) query.getSingleResult();
        } catch (NoResultException ex) {
            result = null;
        }
        return result;
    }
}
TOP

Related Classes of com.evasion.plugin.common.dao.ParametreDaoImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.