In order to work with the unique constraints you will need to remember the following 3 steps.
1. Add an index for a field you wish to be unique:
Java:
configuration.objectClass(Item.class).objectField("field").indexed(true);