/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.rjconsultores.ventaboletos.entidad; import java.io.Serializable; import java.util.Date; 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; import javax.persistence.Transient; /** * * @author gleimar */ @Entity @SequenceGenerator(name = "CONEXION_CTRL_SEQ", sequenceName = "CONEXION_CTRL_SEQ", allocationSize = 1) @Table(name = "CONEXION_CTRL") public class ConexionCtrl implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "CONEXION_CTRL_SEQ") @Column(name = "CONEXIONCTRL_ID") private Long conexionctrlId; @Column(name = "FECMODIF") @Temporal(TemporalType.TIMESTAMP) private Date fecmodif; @Column(name = "ACTIVO") private Boolean activo; @Column(name = "USUARIO_ID") private Integer usuarioId; @Column(name = "ORIGEN_ID") private Integer origenId; @Column(name = "DESTINO_ID") private Integer destinoId; @Transient private Integer grupos; public ConexionCtrl() { } public ConexionCtrl(Integer origenId, Integer destinoId, Integer grupos) { this(); this.origenId = origenId; this.destinoId = destinoId; this.grupos = grupos; } public ConexionCtrl(Long conexionctrlId) { this.conexionctrlId = conexionctrlId; } public Long getConexionctrlId() { return conexionctrlId; } public void setConexionctrlId(Long conexionctrlId) { this.conexionctrlId = conexionctrlId; } public Date getFecmodif() { return fecmodif; } public void setFecmodif(Date fecmodif) { this.fecmodif = fecmodif; } public Boolean getActivo() { return activo; } public void setActivo(Boolean activo) { this.activo = activo; } public Integer getUsuarioId() { return usuarioId; } public void setUsuarioId(Integer usuarioId) { this.usuarioId = usuarioId; } @Override public int hashCode() { int hash = 0; hash += (getConexionctrlId() != null ? getConexionctrlId().hashCode() : 0); return hash; } @Override public boolean equals(Object object) { if (!(object instanceof ConexionCtrl)) { return false; } ConexionCtrl other = (ConexionCtrl) object; if ((this.getConexionctrlId() == null && other.getConexionctrlId() != null) || (this.getConexionctrlId() != null && !this.getConexionctrlId().equals(other.getConexionctrlId()))) { return false; } return true; } @Override public String toString() { return "com.rjconsultores.entidad.ConexionCtrl[ conexionctrlId=" + conexionctrlId + " ]"; } public Integer getOrigenId() { return origenId; } public void setOrigenId(Integer origenId) { this.origenId = origenId; } public Integer getDestinoId() { return destinoId; } public void setDestinoId(Integer destinoId) { this.destinoId = destinoId; } public Integer getGrupos() { return grupos; } public void setGrupos(Integer grupos) { this.grupos = grupos; } public boolean isOrigemDestinoIgual(Integer origemConexaoCtrl, Integer destinoConexaoCtrl) { return getOrigenId().equals(origemConexaoCtrl) && getDestinoId().equals(destinoConexaoCtrl); } }