Spaces:
Sleeping
Sleeping
| package com.cs102.attendance.entity; | |
| import jakarta.persistence.*; | |
| import java.util.Objects; | |
| import java.util.UUID; | |
| public abstract class Entity { | |
| private UUID id; | |
| public UUID getId() { | |
| return id; | |
| } | |
| public void setId(UUID id) { | |
| this.id = id; | |
| } | |
| public boolean equals(Object o) { | |
| if (this == o) return true; | |
| if (o == null || getClass() != o.getClass()) return false; | |
| Entity entity = (Entity) o; | |
| return Objects.equals(id, entity.id); | |
| } | |
| public int hashCode() { | |
| return Objects.hash(id); | |
| } | |
| } |