Hello,
I'm trying to come up with a design in and around my Dao layer so as to be able to warn the end user that the entity he is about to delete, cannot be deleted because it is being referenced by another entity.
As a rookie in Hibernate I don't really know how to go about it.
Should I have a ConstraintViolationException thrown and catch it ?
Or should I check for the no reference before attempting the delete ?
What the Dao delete method should return on failed delete attempt ? A false, the ConstraintViolationException exception, or a custom business friendly exception with a specific business error code ?
Thanks for any design tips !
Stephane
|