UniqueEntity constraint is not able to validate field between associated DTO and entity and this is simple constraint that will check it uniqueness of the same field in DTO and Entity
This constraint is an easy way to implement validation against an entity for your DTO. You just need to remember that your fields in DTO should be named exactly the same as in the entity you want to validate against. Of course it could be more sophisticated like using map for field names in DTO and entity but for now it's enough.
class UniqueDTO extends Constraint