Fixes bug #9449
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@75179 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ed32ccb2e8
commit
d7068b331e
|
@ -91,4 +91,5 @@ public class Constantes {
|
|||
|
||||
public static final String TEMPO_LIMITE_PEN_PARAM_OCD = "TEMPO_LIMITE_PEN_PARAM_OCD";
|
||||
|
||||
public static final String CVESISTEMA_MOTIVO_CANCELAMENTO_ECF = "CANCELAMENTO_ECF";
|
||||
}
|
||||
|
|
|
@ -18,4 +18,6 @@ public interface MotivoCancelacionDAO extends GenericDAO<MotivoCancelacion, Inte
|
|||
public List<MotivoCancelacion> obtenerTodosTipoMotivoB();
|
||||
|
||||
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
||||
|
||||
public MotivoCancelacion findByCveSistema(String cveSistema) ;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
|
@ -15,11 +15,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rafius
|
||||
*/
|
||||
@Repository("motivoCancelacionDAO")
|
||||
@SuppressWarnings("unchecked")
|
||||
public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCancelacion, Integer>
|
||||
implements MotivoCancelacionDAO {
|
||||
|
||||
|
@ -28,7 +32,7 @@ public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCan
|
|||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public List<MotivoCancelacion> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
@ -63,4 +67,17 @@ public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCan
|
|||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public MotivoCancelacion findByCveSistema(String cveSistema) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select mc");
|
||||
sb.append(" from MotivoCancelacion mc");
|
||||
sb.append(" where mc.cveSistema = :cveSistema");
|
||||
sb.append(" and mc.activo=1");
|
||||
|
||||
Query miQry = getSession().createQuery(sb.toString());
|
||||
miQry.setString("cveSistema", cveSistema);
|
||||
|
||||
return (MotivoCancelacion) miQry.uniqueResult();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,6 @@ public interface MotivoCancelacionService extends GenericService<MotivoCancelaci
|
|||
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
||||
|
||||
public boolean validaMotivoCancelacionConstante(MotivoCancelacion motivoCancelacion);
|
||||
|
||||
public MotivoCancelacion findByCveSistema(String cveSistema) ;
|
||||
}
|
||||
|
|
|
@ -79,4 +79,8 @@ public class MotivoCancelacionServiceImpl implements MotivoCancelacionService {
|
|||
return true;
|
||||
}
|
||||
|
||||
public MotivoCancelacion findByCveSistema(String cveSistema) {
|
||||
return motivoCancelacionDAO.findByCveSistema(cveSistema);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue