From ce175d6e3e9b1b2219bf9bdf1ff73ef2cf2f3d40 Mon Sep 17 00:00:00 2001 From: wilian Date: Mon, 24 Nov 2014 18:55:41 +0000 Subject: [PATCH] fixes bug #5847 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@39881 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../dao/TipoIdentificacionDAO.java | 11 ++ .../TipoIdentificacionHibernateDAO.java | 19 ++++ .../ventaboletos/entidad/Cliente.java | 23 ++++ .../entidad/TipoIdentificacion.java | 103 ++++++++++++++++++ .../service/TipoIdentificacionService.java | 11 ++ .../impl/TipoIdentificacionServiceImpl.java | 23 ++++ 6 files changed, 190 insertions(+) create mode 100644 src/com/rjconsultores/ventaboletos/dao/TipoIdentificacionDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/hibernate/TipoIdentificacionHibernateDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/TipoIdentificacion.java create mode 100644 src/com/rjconsultores/ventaboletos/service/TipoIdentificacionService.java create mode 100644 src/com/rjconsultores/ventaboletos/service/impl/TipoIdentificacionServiceImpl.java diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoIdentificacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoIdentificacionDAO.java new file mode 100644 index 000000000..44ca600e1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TipoIdentificacionDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; + +public interface TipoIdentificacionDAO extends GenericDAO { + + public List obtenerTodos(); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoIdentificacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoIdentificacionHibernateDAO.java new file mode 100644 index 000000000..d3bfe465a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoIdentificacionHibernateDAO.java @@ -0,0 +1,19 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.TipoIdentificacionDAO; +import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; + +@Repository("tipoIdentificacionDAO") +public class TipoIdentificacionHibernateDAO extends GenericHibernateDAO implements TipoIdentificacionDAO { + + @Autowired + public TipoIdentificacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Cliente.java b/src/com/rjconsultores/ventaboletos/entidad/Cliente.java index 665befd7f..795f4bf98 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Cliente.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Cliente.java @@ -107,6 +107,12 @@ public class Cliente implements Serializable { private String numIdentificaDos; @Column(name = "INDBLOQUEO") private Boolean indBloqueo; + @JoinColumn(name = "TIPOIDENTIFICAUNO_ID") + @OneToOne + private TipoIdentificacion tipoIdentificacionUno; + @JoinColumn(name = "TIPOIDENTIFICADOS_ID") + @OneToOne + private TipoIdentificacion tipoIdentificacionDos; public Cliente() { } @@ -402,4 +408,21 @@ public class Cliente implements Serializable { public String toString() { return "com.rjconsultores.ventaboletos.entidad.Cliente[ clienteId=" + clienteId + " ]"; } + + public TipoIdentificacion getTipoIdentificacionUno() { + return tipoIdentificacionUno; + } + + public void setTipoIdentificacionUno(TipoIdentificacion tipoIdentificacionUno) { + this.tipoIdentificacionUno = tipoIdentificacionUno; + } + + public TipoIdentificacion getTipoIdentificacionDos() { + return tipoIdentificacionDos; + } + + public void setTipoIdentificacionDos(TipoIdentificacion tipoIdentificacionDos) { + this.tipoIdentificacionDos = tipoIdentificacionDos; + } + } diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoIdentificacion.java b/src/com/rjconsultores/ventaboletos/entidad/TipoIdentificacion.java new file mode 100644 index 000000000..8dcaec3fb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoIdentificacion.java @@ -0,0 +1,103 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "TIPO_IDENTIFICACION") +public class TipoIdentificacion implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "TIPOIDENTIFICACION_ID") + private Integer tipoIdentificacionId; + + @Column(name = "DESCTIPO") + private String desctipo; + + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Integer getTipoIdentificacionId() { + return tipoIdentificacionId; + } + + public void setTipoIdentificacionId(Integer tipoIdentificacionId) { + this.tipoIdentificacionId = tipoIdentificacionId; + } + + public String getDesctipo() { + return desctipo; + } + + public void setDesctipo(String desctipo) { + this.desctipo = desctipo; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public String toString() { + return getDesctipo(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((tipoIdentificacionId == null) ? 0 : tipoIdentificacionId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + TipoIdentificacion other = (TipoIdentificacion) obj; + if (tipoIdentificacionId == null) { + if (other.tipoIdentificacionId != null) + return false; + } else if (!tipoIdentificacionId.equals(other.tipoIdentificacionId)) + return false; + return true; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoIdentificacionService.java b/src/com/rjconsultores/ventaboletos/service/TipoIdentificacionService.java new file mode 100644 index 000000000..79f1f4f6c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/TipoIdentificacionService.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; + +public interface TipoIdentificacionService { + + public List obtenerTodos(); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoIdentificacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoIdentificacionServiceImpl.java new file mode 100644 index 000000000..bee4e57c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoIdentificacionServiceImpl.java @@ -0,0 +1,23 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.rjconsultores.ventaboletos.dao.TipoIdentificacionDAO; +import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; +import com.rjconsultores.ventaboletos.service.TipoIdentificacionService; + +@Service("tipoIdentificacionService") +public class TipoIdentificacionServiceImpl implements TipoIdentificacionService { + + @Autowired + private TipoIdentificacionDAO tipoIdentificacionDAO; + + @Override + public List obtenerTodos() { + return tipoIdentificacionDAO.obtenerTodos(); + } + +}