Merge pull request #6176 from svkirans/master
BAEL-2339 || ResultSet Demo
This commit is contained in:
+19
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+359
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user