bug #7056
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@52248 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
dd50048d21
commit
8af5233821
|
@ -42,7 +42,6 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer>
|
|||
public List<Ruta> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.ne("rutaId", -1));
|
||||
c.addOrder(Order.asc("descruta"));
|
||||
|
||||
return c.list();
|
||||
|
|
|
@ -67,8 +67,9 @@ public class CategoriaCtrl implements Serializable {
|
|||
private List<CategoriaMercado> categoriaMercadoList;
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||
private List<CategoriaOrgao> categoriaOrgaoList;
|
||||
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||
private List<CategoriaRuta> categoriaRutaList;
|
||||
|
||||
public CategoriaCtrl() {
|
||||
|
||||
}
|
||||
|
@ -200,9 +201,26 @@ public class CategoriaCtrl implements Serializable {
|
|||
return tmp;
|
||||
}
|
||||
|
||||
public List<CategoriaRuta> getCategoriaRutaList() {
|
||||
List<CategoriaRuta> tmp = new ArrayList<CategoriaRuta>();
|
||||
if (categoriaRutaList != null) {
|
||||
for (CategoriaRuta cm : this.categoriaRutaList) {
|
||||
if (cm.getActivo()) {
|
||||
tmp.add(cm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void setCategoriaorgaoList(List<CategoriaOrgao> categoriaOrgaoList) {
|
||||
this.categoriaOrgaoList = categoriaOrgaoList;
|
||||
}
|
||||
|
||||
public void setCategoriarutaList(List<CategoriaRuta> categoriaRutaList) {
|
||||
this.categoriaRutaList = categoriaRutaList;
|
||||
}
|
||||
|
||||
public List<CategoriaMarca> getCategoriaMarcaList() {
|
||||
//return categoriaMarcaList;
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
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.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "CATEGORIA_RUTA_SEQ", sequenceName = "CATEGORIA_RUTA_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_RUTA")
|
||||
public class CategoriaRuta implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_RUTA_SEQ")
|
||||
@Column(name = "CATEGORIARUTA_ID")
|
||||
private Integer categoriarutaId;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID")
|
||||
@ManyToOne
|
||||
private Ruta ruta;
|
||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
|
||||
public CategoriaRuta() {
|
||||
}
|
||||
|
||||
public CategoriaRuta(Integer categoriarutaId) {
|
||||
this.categoriarutaId = categoriarutaId;
|
||||
}
|
||||
|
||||
public Integer getCategoriarutaId() {
|
||||
return categoriarutaId;
|
||||
}
|
||||
|
||||
public void setCategoriarutaId(Integer categoriarutaId) {
|
||||
this.categoriarutaId = categoriarutaId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Ruta getRuta() {
|
||||
return ruta;
|
||||
}
|
||||
|
||||
public void setRuta(Ruta ruta) {
|
||||
this.ruta = ruta;
|
||||
}
|
||||
|
||||
public CategoriaCtrl getCategoriaCtrl() {
|
||||
return categoriaCtrl;
|
||||
}
|
||||
|
||||
public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
this.categoriaCtrl = categoriaCtrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final CategoriaRuta other = (CategoriaRuta) obj;
|
||||
if (this.ruta != other.ruta && (this.ruta == null || !this.ruta.equals(other.ruta))) {
|
||||
return false;
|
||||
}
|
||||
if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 97 * hash + (this.ruta != null ? this.ruta.hashCode() : 0);
|
||||
hash = 97 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaOrgao[categoriaorgaoId=" + categoriarutaId + "]";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue