diff --git a/src/main/kotlin/uk/co/neviyn/booru/Entity.kt b/src/main/kotlin/uk/co/neviyn/booru/Entity.kt index e0743c9..ed48862 100644 --- a/src/main/kotlin/uk/co/neviyn/booru/Entity.kt +++ b/src/main/kotlin/uk/co/neviyn/booru/Entity.kt @@ -41,7 +41,22 @@ open class Member( @SequenceGenerator(name="member_id_seq", sequenceName = "member_id_seq", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_id_seq") open var id: Long = -1 -) +) { + override fun equals(other: Any?): Boolean { + if(other === this) return true + return if(other is Member){ + other.id == id + } else false + } + + override fun hashCode(): Int { + var result = name.hashCode() + result = 31 * result + email.hashCode() + result = 31 * result + password.hashCode() + result = 31 * result + id.hashCode() + return result + } +} @Entity open class Role(