com.evasion.plugin.geoloc.dao.RegionAdmDAO Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/
package com.evasion.plugin.geoloc.dao;
import com.evasion.dao.api.AbstractJPAGenericDAO;
import com.evasion.entity.geolocation.AdminDivision;
import javax.persistence.NoResultException;
import javax.persistence.Query;
/**
* DAO pour la manipulation des Business Object de type {@link RegionAdm}.
*
* @author sebastien
*/
public class RegionAdmDAO extends AbstractJPAGenericDAO {
/**
* *
* serialVersionUID.
*/
private static final long serialVersionUID = 1L;
public AdminDivision findByAdmCode(String admCode) {
AdminDivision result;
Query query = (Query) getEntityManager().
createNamedQuery(AdminDivision.QUERY_FIND_BY_ADMCODE);
query.setParameter(1, admCode);
try {
result = (AdminDivision) query.getSingleResult();
} catch (NoResultException ex) {
result = null;
}
return result;
}
}