How can i solve this problem in a clean and DB independent way? Imagine i have a Vehicle Object which has several properties that should be unique e.g. chasis no, engine no and registration number. How can i detect if any of this constraints is being violated and then being able to present the user with a clear error message that clearly indicates which property(s) violated the constraint?
I've tried selecting before saving and it worked for first time saves but fell apart when i tried to do updates. Or is it not possible to do this in DB independent way?