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

com.evasion.plugin.common.dao.TemplateDaoImpl 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.Template;
import javax.persistence.Query;

/**
 *
 * @author sebastien
 */
public class TemplateDaoImpl extends AbstractJPAGenericDAO {

    public String findByKeyAndLocale(String key, String lanquage) {
        StringBuilder queryString = new StringBuilder("select t.text from "+Template.ENTITY_NAME+" t where");
        queryString.append(" t.keyTp=:key and t.language=:language");

        Query query = getEntityManager().createQuery(queryString.toString());

        query.setParameter("key", key);
        query.setParameter("language", lanquage);

        return (String) query.getSingleResult();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy