Unique constraint in DQL

Thank you for replying.
for example, I want usernames to be unique in my application