equals and hashCode methods for DTOs