我有一个网站用户的更新页面。的某些列user
被编码在一个枚举中。的所有信息都user
转到 POJO 并且所有列都经过哈希处理。我的问题是,当我打开此更新页面并更新 any 的一些信息时user
,它可以成功运行。但是,当我在另一台计算机上打开此网页时,更新过程并不清晰。我使用'system.out.println'查看了列的哈希码,我看到两台不同的计算机在使用枚举基础完成的列中生成了两个不同的哈希码。我希望我的问题很清楚。感谢您的回复。
@Override
public int hashCode() {
int hash = 3;
hash = 79 * hash + (this.getId() != null ? this.getId().hashCode() : 0);
hash = 79 * hash + (this.kullaniciTipi != null ? this.kullaniciTipi.hashCode() : 0);
hash = 79 * hash + (this.kullaniciAdi != null ? this.kullaniciAdi.hashCode() : 0);
hash = 79 * hash + (this.parola != null ? this.parola.hashCode() : 0);
hash = 79 * hash + Arrays.hashCode(this.parmakIzi);
hash = 79 * hash + (this.zamanAsimi != null ? this.zamanAsimi.hashCode() : 0);
hash = 79 * hash + (this.tcKimlikNo != null ? this.tcKimlikNo.hashCode() : 0);
hash = 79 * hash + (this.adiSoyadi != null ? this.adiSoyadi.hashCode() : 0);
hash = 79 * hash + (this.epostaAdresi != null ? this.epostaAdresi.hashCode() : 0);
hash = 79 * hash + (this.ekranKisayol != null ? this.ekranKisayol.hashCode() : 0);
hash = 79 * hash + (this.hataliGirisSayisi != null ? this.hataliGirisSayisi.hashCode() : 0);
hash = 79 * hash + Objects.hashCode(this.durum);
hash = 79 * hash + (this.durum != null ? this.durum.hashCode() : 0);
System.out.println("id : " + this.getId() + "id hash : " +this.getId().hashCode());
System.out.println("zid : " + this.zamanAsimi + "zid hash : " +this.zamanAsimi.hashCode());
System.out.println("this.kullaniciTipi.hashCode()" + this.kullaniciTipi.hashCode());
System.out.println("this.kullaniciAdi.hashCode()" + this.kullaniciAdi.hashCode());
System.out.println("this.parola.hashCode()" + this.parola.hashCode());
// System.out.println("this.parmakIzi.hashCode()" + this.parmakIzi.hashCode());
System.out.println("this.zamanAsimi.hashCode()" + this.zamanAsimi.hashCode());
System.out.println("this.tcKimlikNo.hashCode()" + this.tcKimlikNo.hashCode());
System.out.println("this.adiSoyadi.hashCode()" + this.adiSoyadi.hashCode());
System.out.println("this.epostaAdresi.hashCode()" + this.epostaAdresi.hashCode());
// System.out.println("this.ekranKisayol.hashCode()" + this.ekranKisayol.hashCode());
System.out.println("this.hataliGirisSayisi.hashCode()" + this.hataliGirisSayisi.hashCode());
System.out.println("this.durum.hashCode()" + this.durum.hashCode());
System.out.println("sistem hash : " +hash);
return hash;
}