AdmMono/src/com/rjconsultores/ventaboletos/entidad/PerfilFuncion.java

148 lines
4.1 KiB
Java

/*
* 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.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;
/**
*
* @author rodrigo
*/
@Entity
@Table(name = "PERFIL_FUNCION")
@SequenceGenerator(name = "PERFIL_FUNCION_SEQ", sequenceName = "PERFIL_FUNCION_SEQ", allocationSize = 1)
public class PerfilFuncion implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "PERFILFUNCION_ID")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PERFIL_FUNCION_SEQ")
private Integer perfilfuncionId;
@Column(name = "ACTIVO")
private Boolean activo;
@Column(name = "FECMODIF")
@Temporal(TemporalType.TIMESTAMP)
private Date fecmodif;
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@JoinColumn(name = "PERFIL_ID", referencedColumnName = "PERFIL_ID")
@ManyToOne
private Perfil perfil;
@JoinColumn(name = "FUNCIONSISTEMA_ID", referencedColumnName = "FUNCIONSISTEMA_ID")
@ManyToOne
private FuncionSistema funcionSistema;
@Column(name = "INDLECTURA")
private Boolean indLectura;
public PerfilFuncion() {
}
public PerfilFuncion(Integer perfilfuncionId) {
this.perfilfuncionId = perfilfuncionId;
}
public Integer getPerfilfuncionId() {
return perfilfuncionId;
}
public void setPerfilfuncionId(Integer perfilfuncionId) {
this.perfilfuncionId = perfilfuncionId;
}
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 Perfil getPerfil() {
return perfil;
}
public void setPerfil(Perfil perfil) {
this.perfil = perfil;
}
public FuncionSistema getFuncionSistema() {
return funcionSistema;
}
public void setFuncionSistema(FuncionSistema funcionSistema) {
this.funcionSistema = funcionSistema;
}
public Boolean getIndLectura() {
return indLectura;
}
public void setIndLectura(Boolean indLectura) {
this.indLectura = indLectura;
}
@Override
public int hashCode() {
int hash = 0;
hash += (perfilfuncionId != null ? perfilfuncionId.hashCode() : 0);
return hash;
}
@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 PerfilFuncion)) {
return false;
}
PerfilFuncion other = (PerfilFuncion) object;
if((this.funcionSistema != null && other.funcionSistema != null) && this.perfilfuncionId == null && other.perfilfuncionId == null && this.funcionSistema.equals(other.funcionSistema)){
return true;
}
if ((this.perfilfuncionId == null && other.perfilfuncionId != null) || (this.perfilfuncionId != null && !this.perfilfuncionId.equals(other.perfilfuncionId))) {
return false;
}
if((this.perfilfuncionId == other.perfilfuncionId) && (this.getFuncionSistema().getFuncionsistemaId() != other.getFuncionSistema().getFuncionsistemaId())) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.rjconsultores.ventaboletos.entidad.PerfilFuncion[perfilfuncionId=" + perfilfuncionId + "]";
}
}