Novas Informação Ônibus (fixed bug #5391)
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@36109 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ae91009f83
commit
233989ea1c
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Autobus;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.AutobusDoc;
|
||||||
|
|
||||||
|
public interface AutobusDocDAO extends GenericDAO<AutobusDoc, Integer> {
|
||||||
|
public List<AutobusDoc> obtenerPorAutobus(Autobus autobus);
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MarcaAutobus;
|
||||||
|
|
||||||
|
|
||||||
|
public interface MarcaAutobusDAO extends GenericDAO<MarcaAutobus, Integer> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoDocAutobus;
|
||||||
|
|
||||||
|
public interface TipoDocAutobusDAO extends GenericDAO<TipoDocAutobus, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.AutobusDocDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Autobus;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.AutobusDoc;
|
||||||
|
|
||||||
|
@Repository("autobusDocDAO")
|
||||||
|
public class AutobusDocHibernateDAO extends GenericHibernateDAO<AutobusDoc, Integer>
|
||||||
|
implements AutobusDocDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AutobusDocHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AutobusDoc> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AutobusDoc> obtenerPorAutobus(Autobus autobus) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("autobus", autobus));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.MarcaAutobusDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MarcaAutobus;
|
||||||
|
|
||||||
|
@Repository("marcaAutobusDAO")
|
||||||
|
public class MarcaAutobusHibernateDAO extends GenericHibernateDAO<MarcaAutobus, Integer>
|
||||||
|
implements MarcaAutobusDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MarcaAutobusHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MarcaAutobus> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
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.TipoDocAutobusDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoDocAutobus;
|
||||||
|
|
||||||
|
@Repository("tipoDocAutobusDAO")
|
||||||
|
public class TipoDocAutobusHibernateDAO extends GenericHibernateDAO<TipoDocAutobus, Integer>
|
||||||
|
implements TipoDocAutobusDAO {
|
||||||
|
@Autowired
|
||||||
|
public TipoDocAutobusHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.entidad;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -38,6 +39,22 @@ public class Autobus implements Serializable {
|
||||||
private Integer autobusId;
|
private Integer autobusId;
|
||||||
@Column(name = "NUMAUTOBUS")
|
@Column(name = "NUMAUTOBUS")
|
||||||
private String numautobus;
|
private String numautobus;
|
||||||
|
@Column(name = "CANTPARADOS")
|
||||||
|
private Integer cantparados;
|
||||||
|
@Column(name = "DESCMODELO")
|
||||||
|
private String descmodelo;
|
||||||
|
@Column(name = "ANO")
|
||||||
|
private Integer ano;
|
||||||
|
@Column(name = "INDBANO")
|
||||||
|
private Boolean indbano;
|
||||||
|
@Column(name = "INDVIDEO")
|
||||||
|
private Boolean indvideo;
|
||||||
|
@Column(name = "INDAIRE")
|
||||||
|
private Boolean indaire;
|
||||||
|
@Column(name = "NUMMATRICULA")
|
||||||
|
private String nummatricula;
|
||||||
|
@Column(name = "PATRON")
|
||||||
|
private String patron;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
@Column(name = "FECMODIF")
|
@Column(name = "FECMODIF")
|
||||||
|
@ -53,6 +70,17 @@ public class Autobus implements Serializable {
|
||||||
private DiagramaAutobus diagramaAutobusPiso;
|
private DiagramaAutobus diagramaAutobusPiso;
|
||||||
@OneToMany(mappedBy = "autobus")
|
@OneToMany(mappedBy = "autobus")
|
||||||
private List<Corrida> corridaList;
|
private List<Corrida> corridaList;
|
||||||
|
@JoinColumn(name = "MARCAAUTOBUS_ID", referencedColumnName = "MARCAAUTOBUS_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private MarcaAutobus marcaAutobus;
|
||||||
|
@JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private ClaseServicio claseServicio;
|
||||||
|
@JoinColumn(name = "CIUDAD_ID", referencedColumnName = "CIUDAD_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Ciudad ciudad;
|
||||||
|
@OneToMany(mappedBy = "autobus")
|
||||||
|
private List<AutobusDoc> autobusDocList;
|
||||||
|
|
||||||
public Autobus() {
|
public Autobus() {
|
||||||
}
|
}
|
||||||
|
@ -125,14 +153,118 @@ public class Autobus implements Serializable {
|
||||||
this.diagramaAutobusPiso = diagramaAutobusPiso;
|
this.diagramaAutobusPiso = diagramaAutobusPiso;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public Integer getCantparados() {
|
||||||
|
return cantparados;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCantparados(Integer cantparados) {
|
||||||
|
this.cantparados = cantparados;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescmodelo() {
|
||||||
|
return descmodelo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescmodelo(String descmodelo) {
|
||||||
|
this.descmodelo = descmodelo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAno() {
|
||||||
|
return ano;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAno(Integer ano) {
|
||||||
|
this.ano = ano;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndbano() {
|
||||||
|
return indbano;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndbano(Boolean indbano) {
|
||||||
|
this.indbano = indbano;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndvideo() {
|
||||||
|
return indvideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndvideo(Boolean indvideo) {
|
||||||
|
this.indvideo = indvideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndaire() {
|
||||||
|
return indaire;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndaire(Boolean indaire) {
|
||||||
|
this.indaire = indaire;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNummatricula() {
|
||||||
|
return nummatricula;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNummatricula(String nummatricula) {
|
||||||
|
this.nummatricula = nummatricula;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPatron() {
|
||||||
|
return patron;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPatron(String patron) {
|
||||||
|
this.patron = patron;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClaseServicio getClaseServicio() {
|
||||||
|
return claseServicio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClaseServicio(ClaseServicio claseServicio) {
|
||||||
|
this.claseServicio = claseServicio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ciudad getCiudad() {
|
||||||
|
return ciudad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCiudad(Ciudad ciudad) {
|
||||||
|
this.ciudad = ciudad;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
hash += (autobusId != null ? autobusId.hashCode() : 0);
|
hash += (autobusId != null ? autobusId.hashCode() : 0);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public MarcaAutobus getMarcaAutobus() {
|
||||||
|
return marcaAutobus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarcaAutobus(MarcaAutobus marcaAutobus) {
|
||||||
|
this.marcaAutobus = marcaAutobus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AutobusDoc> getAutobusDocList() {
|
||||||
|
return autobusDocList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutobusDocList(List<AutobusDoc> autobusDocList) {
|
||||||
|
this.autobusDocList = autobusDocList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDoc(AutobusDoc doc){
|
||||||
|
this.autobusDocList.add(doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeDoc(AutobusDoc doc){
|
||||||
|
this.autobusDocList.remove(doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||||
if (!(object instanceof Autobus)) {
|
if (!(object instanceof Autobus)) {
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "AUTOBUS_DOC_SEQ", sequenceName = "AUTOBUS_DOC_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "AUTOBUS_DOC")
|
||||||
|
public class AutobusDoc {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "AUTOBUSDOC_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "AUTOBUS_DOC_SEQ")
|
||||||
|
private Integer autobusDocId;
|
||||||
|
@JoinColumn(name = "AUTOBUS_ID", referencedColumnName = "AUTOBUS_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Autobus autobus;
|
||||||
|
@JoinColumn(name = "TIPODOCAUTOBUS_ID", referencedColumnName = "TIPODOCAUTOBUS_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private TipoDocAutobus tipoDocAutobus;
|
||||||
|
@Column(name = "FECHACADUCIDAD")
|
||||||
|
private Date fechaCaducidad;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
public Integer getAutobusDocId() {
|
||||||
|
return autobusDocId;
|
||||||
|
}
|
||||||
|
public void setAutobusDocId(Integer autobusDocId) {
|
||||||
|
this.autobusDocId = autobusDocId;
|
||||||
|
}
|
||||||
|
public Autobus getAutobus() {
|
||||||
|
return autobus;
|
||||||
|
}
|
||||||
|
public void setAutobus(Autobus autobus) {
|
||||||
|
this.autobus = autobus;
|
||||||
|
}
|
||||||
|
public TipoDocAutobus getTipoDocAutobus() {
|
||||||
|
return tipoDocAutobus;
|
||||||
|
}
|
||||||
|
public void setTipoDocAutobus(TipoDocAutobus tipoDocAutobus) {
|
||||||
|
this.tipoDocAutobus = tipoDocAutobus;
|
||||||
|
}
|
||||||
|
public Date getFechaCaducidad() {
|
||||||
|
return fechaCaducidad;
|
||||||
|
}
|
||||||
|
public void setFechaCaducidad(Date fechaCaducidad) {
|
||||||
|
this.fechaCaducidad = fechaCaducidad;
|
||||||
|
}
|
||||||
|
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 boolean equals(Object object) {
|
||||||
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||||
|
if (!(object instanceof AutobusDoc)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AutobusDoc other = (AutobusDoc) object;
|
||||||
|
if ((this.autobusDocId == null && other.autobusDocId != null) || (this.autobusDocId != null && !this.autobusDocId.equals(other.autobusDocId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "MARCA_AUTOBUS_SEQ", sequenceName = "MARCA_AUTOBUS_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "MARCA_AUTOBUS")
|
||||||
|
public class MarcaAutobus implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "MARCA_AUTOBUS_SEQ")
|
||||||
|
@Column(name = "MARCAAUTOBUS_ID")
|
||||||
|
private Long marcaAutobusId;
|
||||||
|
@Column(name = "DESCMARCA")
|
||||||
|
private String descmarca;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Long getMarcaAutobusId() {
|
||||||
|
return marcaAutobusId;
|
||||||
|
}
|
||||||
|
public void setMarcaAutobusId(Long marcaAutobusId) {
|
||||||
|
this.marcaAutobusId = marcaAutobusId;
|
||||||
|
}
|
||||||
|
public String getDescmarca() {
|
||||||
|
return descmarca;
|
||||||
|
}
|
||||||
|
public void setDescmarca(String descmarca) {
|
||||||
|
this.descmarca = descmarca;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "TIPO_DOC_AUTOBUS_SEQ", sequenceName = "TIPO_DOC_AUTOBUS_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "TIPO_DOC_AUTOBUS")
|
||||||
|
public class TipoDocAutobus {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "TIPODOCAUTOBUS_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_DOC_AUTOBUS_SEQ")
|
||||||
|
private Integer tipoDocAutobusId;
|
||||||
|
@Column(name = "DESCDOC")
|
||||||
|
private String descDoc;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
public Integer getTipoDocAutobusId() {
|
||||||
|
return tipoDocAutobusId;
|
||||||
|
}
|
||||||
|
public void setTipoDocAutobusId(Integer tipoDocAutobusId) {
|
||||||
|
this.tipoDocAutobusId = tipoDocAutobusId;
|
||||||
|
}
|
||||||
|
public String getDescDoc() {
|
||||||
|
return descDoc;
|
||||||
|
}
|
||||||
|
public void setDescDoc(String descDoc) {
|
||||||
|
this.descDoc = descDoc;
|
||||||
|
}
|
||||||
|
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 this.descDoc;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Autobus;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.AutobusDoc;
|
||||||
|
|
||||||
|
public interface AutobusDocService extends GenericService<AutobusDoc, Integer> {
|
||||||
|
public List<AutobusDoc> obtenerPorAutobus(Autobus autobus);
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MarcaAutobus;
|
||||||
|
|
||||||
|
public interface MarcaAutobusService extends GenericService<MarcaAutobus, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoDocAutobus;
|
||||||
|
|
||||||
|
public interface TipoDocAutobusService extends GenericService<TipoDocAutobus, Integer> {
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.AutobusDocDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Autobus;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.AutobusDoc;
|
||||||
|
import com.rjconsultores.ventaboletos.service.AutobusDocService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("autobusDocService")
|
||||||
|
public class AutobusDocServiceImpl implements AutobusDocService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AutobusDocDAO autobusDocDAO;
|
||||||
|
|
||||||
|
public List<AutobusDoc> obtenerTodos() {
|
||||||
|
return autobusDocDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AutobusDoc obtenerID(Integer id) {
|
||||||
|
return autobusDocDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AutobusDoc> obtenerPorAutobus(Autobus autobus){
|
||||||
|
return autobusDocDAO.obtenerPorAutobus(autobus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public AutobusDoc suscribir(AutobusDoc entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return autobusDocDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public AutobusDoc actualizacion(AutobusDoc entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return autobusDocDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(AutobusDoc entidad) {
|
||||||
|
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
autobusDocDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.MarcaAutobusDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MarcaAutobus;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MarcaAutobusService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("marcaAutobusService")
|
||||||
|
public class MarcaAutobusServiceImpl implements MarcaAutobusService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MarcaAutobusDAO marcaAutobusDAO;
|
||||||
|
|
||||||
|
public List<MarcaAutobus> obtenerTodos() {
|
||||||
|
return marcaAutobusDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MarcaAutobus obtenerID(Integer id) {
|
||||||
|
return marcaAutobusDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public MarcaAutobus suscribir(MarcaAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return marcaAutobusDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public MarcaAutobus actualizacion(MarcaAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return marcaAutobusDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(MarcaAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
marcaAutobusDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.TipoDocAutobusDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoDocAutobus;
|
||||||
|
import com.rjconsultores.ventaboletos.service.TipoDocAutobusService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("tipoDocAutobusService")
|
||||||
|
public class TipoDocAutobusServiceImpl implements TipoDocAutobusService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TipoDocAutobusDAO tipoDocAutobusDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TipoDocAutobus> obtenerTodos() {
|
||||||
|
return tipoDocAutobusDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TipoDocAutobus obtenerID(Integer id) {
|
||||||
|
return tipoDocAutobusDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public TipoDocAutobus suscribir(TipoDocAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return tipoDocAutobusDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public TipoDocAutobus actualizacion(TipoDocAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return tipoDocAutobusDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(TipoDocAutobus entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
tipoDocAutobusDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue