fixes bug #6376
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@44982 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
be948813f0
commit
e79f4da427
|
@ -1,5 +1,9 @@
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.criterion.Criterion;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||||
|
|
||||||
public interface PacoteDAO extends GenericDAO<Pacote, Integer> {
|
public interface PacoteDAO extends GenericDAO<Pacote, Integer> {
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
@ -18,8 +22,14 @@ public class PacoteHibernateDAO extends GenericHibernateDAO<Pacote, Integer> imp
|
||||||
public PacoteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public PacoteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public List<Pacote> obtenerTodos() {
|
||||||
|
Criteria c = this.makeCriteria();
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class Pacote implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Pacote [pacoteId=" + pacoteId + ", nompacote=" + nompacote + ", descpacote=" + descpacote + ", indvendaagencia=" + indvendaagencia + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", ruta=" + ruta + "]";
|
return this.getNompacote();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Empresa getEmpresa() {
|
public Empresa getEmpresa() {
|
||||||
|
|
|
@ -63,6 +63,10 @@ public class VendaPacote implements Serializable {
|
||||||
|
|
||||||
@Column(name = "USUARIO_CANCELAMENTO_ID")
|
@Column(name = "USUARIO_CANCELAMENTO_ID")
|
||||||
private Integer usuarioCancelamentoId;
|
private Integer usuarioCancelamentoId;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "USUARIO_ID")
|
||||||
|
private Usuario usuario;
|
||||||
|
|
||||||
@Column(name = "SUBTOTAL")
|
@Column(name = "SUBTOTAL")
|
||||||
private BigDecimal subtotal;
|
private BigDecimal subtotal;
|
||||||
|
@ -169,4 +173,12 @@ public class VendaPacote implements Serializable {
|
||||||
this.enderecoApanhes = enderecoApanhes;
|
this.enderecoApanhes = enderecoApanhes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Usuario getUsuario() {
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuario(Usuario usuario) {
|
||||||
|
this.usuario = usuario;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,5 +23,18 @@ public enum LocalEnderecoApanhe {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.descricao;
|
return this.descricao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LocalEnderecoApanhe getLocalEnderecoApanhe(Integer valor) {
|
||||||
|
if(APANHE_EM_CASA.getValor().equals(valor)) {
|
||||||
|
return APANHE_EM_CASA;
|
||||||
|
} else if(HOTEL.getValor().equals(valor)) {
|
||||||
|
return HOTEL;
|
||||||
|
} else if(NENHUM.getValor().equals(valor)) {
|
||||||
|
return NENHUM;
|
||||||
|
} else if(REGIAO_METROPOLITANA.getValor().equals(valor)) {
|
||||||
|
return REGIAO_METROPOLITANA;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue