posted 13 years ago
Hi Everyone,
We've written a very large app using hibernate. Our database has a ton of unique indexes and constraints. Rather than check that the constraint is satisfied prior to updating the database, I'd like to
1) update the database
2) If a constraint violation happens at the db, catch the constraint violation exception
3) use the constraint name that is returned in the exception to look up an english description of the problem
4) Display that message to the user... such as 'There is already a person record with that firstname/lastname/address'
Hopefully I've explained my problem well. Does anyone know if there is a faclity in oracle to attach a description to the constraints you create. If so we'd likely be able to look up that description from the database based on the constraint name? Is there a better way to do this using hibernate?
Thanks again for all your help.
Cory
There are only 10 types of people in this world... Those who understand binary and those who don't.