Merge pull request #6176 from svkirans/master

BAEL-2339 || ResultSet Demo
This commit is contained in:
Eric Martin
2019-03-08 07:37:10 -06:00
committed by GitHub
2 changed files with 378 additions and 0 deletions
@@ -1,5 +1,7 @@
package com.baeldung.jdbc;
import java.util.Objects;
public class Employee {
private int id;
private String name;
@@ -48,4 +50,21 @@ public class Employee {
this.position = position;
}
@Override
public int hashCode() {
return Objects.hash(id, name, position, salary);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Employee other = (Employee) obj;
return id == other.id && Objects.equals(name, other.name) && Objects.equals(position, other.position) && Double.doubleToLongBits(salary) == Double.doubleToLongBits(other.salary);
}
}