bug #8121
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@64307 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8da406f4c1
commit
17996c26f4
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -133,14 +134,20 @@ public class AidfHibernateDAO extends GenericHibernateDAO<Aidf, Long> implements
|
||||||
@Override
|
@Override
|
||||||
public List<Aidf> buscaAidfRMD(Integer empresaId, Integer estadoId) {
|
public List<Aidf> buscaAidfRMD(Integer empresaId, Integer estadoId) {
|
||||||
|
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
StringBuilder sb = new StringBuilder();
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
sb.append(" from Aidf ");
|
||||||
c.add(Restrictions.eq("estado.estadoId", estadoId));
|
sb.append(" where activo = :activo ");
|
||||||
c.add(Restrictions.eq("empresa.empresaId", empresaId));
|
sb.append(" and estado.estadoId = :estadoId ");
|
||||||
|
sb.append(" and empresa.empresaId = :empresaId ");
|
||||||
// c.add(Restrictions.eq("aidfEspecie.decespecie", "RMD"));
|
sb.append(" and aidfEspecie.decespecie = 'RMD' ");
|
||||||
|
|
||||||
return (List<Aidf>) c.list();
|
Query query = getSession().createQuery(sb.toString());
|
||||||
|
|
||||||
|
query.setBoolean("activo", Boolean.TRUE);
|
||||||
|
query.setInteger("estadoId", estadoId);
|
||||||
|
query.setInteger("empresaId", empresaId);
|
||||||
|
|
||||||
|
return (List<Aidf>) query.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,8 @@ import org.hibernate.annotations.GenericGenerator;
|
||||||
@Table(name = "AIDF")
|
@Table(name = "AIDF")
|
||||||
public class Aidf implements java.io.Serializable {
|
public class Aidf implements java.io.Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Long aidfId;
|
private Long aidfId;
|
||||||
private AidfTipo aidfTipo;
|
private AidfTipo aidfTipo;
|
||||||
private AidfEspecie aidfEspecie;
|
private AidfEspecie aidfEspecie;
|
||||||
|
|
|
@ -18,6 +18,8 @@ import javax.persistence.TemporalType;
|
||||||
@Table(name = "AIDF_ESPECIE")
|
@Table(name = "AIDF_ESPECIE")
|
||||||
public class AidfEspecie implements java.io.Serializable {
|
public class AidfEspecie implements java.io.Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Integer aidfespId;
|
private Integer aidfespId;
|
||||||
private String decespecie;
|
private String decespecie;
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
|
@ -30,32 +32,32 @@ public class AidfEspecie implements java.io.Serializable {
|
||||||
public AidfEspecie(Integer aidfespId) {
|
public AidfEspecie(Integer aidfespId) {
|
||||||
this.aidfespId = aidfespId;
|
this.aidfespId = aidfespId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return decespecie;
|
return decespecie;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
int hash = 0;
|
|
||||||
hash += (aidfespId != null ? aidfespId.hashCode() : 0);
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object object) {
|
public int hashCode() {
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
int hash = 0;
|
||||||
if (!(object instanceof AidfEspecie))
|
hash += (aidfespId != null ? aidfespId.hashCode() : 0);
|
||||||
return false;
|
return hash;
|
||||||
|
}
|
||||||
AidfEspecie other = (AidfEspecie) object;
|
|
||||||
if ((this.aidfespId == null && other.aidfespId != null) || (this.aidfespId != null && !this.aidfespId.equals(other.aidfespId))) {
|
@Override
|
||||||
return false;
|
public boolean equals(Object object) {
|
||||||
}
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||||
return true;
|
if (!(object instanceof AidfEspecie))
|
||||||
}
|
return false;
|
||||||
|
|
||||||
|
AidfEspecie other = (AidfEspecie) object;
|
||||||
|
if ((this.aidfespId == null && other.aidfespId != null) || (this.aidfespId != null && !this.aidfespId.equals(other.aidfespId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public AidfEspecie(Integer aidfespId, String decespecie, Boolean activo, Date fecmodif, Integer usuarioId) {
|
public AidfEspecie(Integer aidfespId, String decespecie, Boolean activo, Date fecmodif, Integer usuarioId) {
|
||||||
this.aidfespId = aidfespId;
|
this.aidfespId = aidfespId;
|
||||||
this.decespecie = decespecie;
|
this.decespecie = decespecie;
|
||||||
|
|
Loading…
Reference in New Issue