From 7be94a7e534329bf7d5e7436ca137603c2158e14 Mon Sep 17 00:00:00 2001 From: "fabricio.oliveira" Date: Thu, 28 Feb 2019 22:42:57 +0000 Subject: [PATCH] =?UTF-8?q?0013654:=20GLPI=2012207=20-=20Duplicidade=20de?= =?UTF-8?q?=20empresa=20no=20usu=C3=A1rio=20fixes=20bug#13654=20dev:Lucas?= =?UTF-8?q?=20Tai=C3=A3=20qua:Juliane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@90425 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/UsuarioEmpresa.java | 81 ++++++++++++++----- 1 file changed, 62 insertions(+), 19 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/UsuarioEmpresa.java b/src/com/rjconsultores/ventaboletos/entidad/UsuarioEmpresa.java index a572e1127..beb9fa6cd 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/UsuarioEmpresa.java +++ b/src/com/rjconsultores/ventaboletos/entidad/UsuarioEmpresa.java @@ -120,27 +120,70 @@ public class UsuarioEmpresa implements Serializable { this.indValidaPreimpreso = indValidaPreimpreso; } - @Override - public int hashCode() { - int hash = 0; - hash += (usuarioEmpresaId != null ? usuarioEmpresaId.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 UsuarioEmpresa)) { - return false; - } - UsuarioEmpresa other = (UsuarioEmpresa) object; - if ((this.usuarioEmpresaId == null && other.usuarioEmpresaId != null) || (this.usuarioEmpresaId != null && !this.usuarioEmpresaId.equals(other.usuarioEmpresaId))) { - return false; - } - return true; - } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((activo == null) ? 0 : activo.hashCode()); + result = prime * result + ((empresa == null) ? 0 : empresa.hashCode()); + result = prime * result + ((fecmodif == null) ? 0 : fecmodif.hashCode()); + result = prime * result + ((indValidaPreimpreso == null) ? 0 : indValidaPreimpreso.hashCode()); + result = prime * result + ((usuarioEmpresaId == null) ? 0 : usuarioEmpresaId.hashCode()); + result = prime * result + ((usuarioLog == null) ? 0 : usuarioLog.hashCode()); + result = prime * result + ((usuariomodifId == null) ? 0 : usuariomodifId.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; + UsuarioEmpresa other = (UsuarioEmpresa) obj; + if (activo == null) { + if (other.activo != null) + return false; + } else if (!activo.equals(other.activo)) + return false; + if (empresa == null) { + if (other.empresa != null) + return false; + } else if (!empresa.equals(other.empresa)) + return false; + if (fecmodif == null) { + if (other.fecmodif != null) + return false; + } else if (!fecmodif.equals(other.fecmodif)) + return false; + if (indValidaPreimpreso == null) { + if (other.indValidaPreimpreso != null) + return false; + } else if (!indValidaPreimpreso.equals(other.indValidaPreimpreso)) + return false; + if (usuarioEmpresaId == null) { + if (other.usuarioEmpresaId != null) + return false; + } else if (!usuarioEmpresaId.equals(other.usuarioEmpresaId)) + return false; + if (usuarioLog == null) { + if (other.usuarioLog != null) + return false; + } else if (!usuarioLog.equals(other.usuarioLog)) + return false; + if (usuariomodifId == null) { + if (other.usuariomodifId != null) + return false; + } else if (!usuariomodifId.equals(other.usuariomodifId)) + return false; + return true; + } + + @Override public String toString() { return "com.rjconsultores.ventaboletos.entidad.UsuarioEmpresa[usuarioEmpresaId=" + usuarioEmpresaId + "]"; }