bug #6757
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@49177 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c52422052f
commit
72aad6e8c8
|
@ -4,5 +4,5 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.SeguradoraEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.SeguradoraEmpresa;
|
||||||
|
|
||||||
public interface SeguradoraEmpresaDAO extends GenericDAO<SeguradoraEmpresa, Integer> {
|
public interface SeguradoraEmpresaDAO extends GenericDAO<SeguradoraEmpresa, Integer> {
|
||||||
public boolean existe(Empresa empresa);
|
public boolean existe(Empresa empresa, String serie);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,11 @@ public class SeguradoraEmpresaHibernateDAO extends GenericHibernateDAO<Segurador
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean existe(Empresa empresa){
|
public boolean existe(Empresa empresa, String serie){
|
||||||
Criteria c = makeCriteria();
|
Criteria c = makeCriteria();
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
c.add(Restrictions.eq("empresa", empresa));
|
c.add(Restrictions.eq("empresa", empresa));
|
||||||
|
c.add(Restrictions.eq("serie", serie));
|
||||||
return !c.list().isEmpty();
|
return !c.list().isEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,6 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.SeguradoraEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.SeguradoraEmpresa;
|
||||||
|
|
||||||
public interface SeguradoraEmpresaService extends GenericService<SeguradoraEmpresa, Integer>{
|
public interface SeguradoraEmpresaService extends GenericService<SeguradoraEmpresa, Integer>{
|
||||||
public boolean existe(Empresa empresa);
|
public boolean existe(Empresa empresa, String serie);
|
||||||
|
|
||||||
}
|
}
|
|
@ -27,8 +27,8 @@ public class SeguradoraEmpresaServiceImpl implements SeguradoraEmpresaService {
|
||||||
return seguradoraEmpresaDAO.obtenerID(id);
|
return seguradoraEmpresaDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean existe(Empresa empresa){
|
public boolean existe(Empresa empresa, String serie){
|
||||||
return seguradoraEmpresaDAO.existe(empresa);
|
return seguradoraEmpresaDAO.existe(empresa, serie);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|
Loading…
Reference in New Issue