All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evasion.plugin.common.dao.ParametreDaoImpl Maven / Gradle / Ivy

/*
 * 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 {

    /**
     * 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;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy