Today I'd like to share a quick (and dirty) trick to handle one nuisance of well known pattern to achieve uniqueness of "non-primary key" ADFBC entity attributes. If you ever needed to enforce a particular attribute to contain globally unique values you may end up with two solutions:
1. Check it on the db site and then handle the unique constraint violation exception in DCExceptionHandler replacing dirty SQL message with a pretty one that you provide
2. Try to catch it before it even reaches DB and handle it in a nice way using entity validation messages
Obviously the second approach seems to be much better from both architectural and practical point of view (let alone the fact that it does not rule out using the former one at the same time!).