Miguel Henley wrote:
I know that I can implement the Validatable interface at the persistence class to 
check for invariant.
But supose that the invariant depends of the operation -- if the persistence class is going to 
be "inserted" at the database the rules is not the same for the update operation.
What is the best practice to do for this situation ?

Class invariants, by definition, are always true.


If you want context sensitive tests, you can return false from Interceptor.onSave() or Interceptor.onFlushDirty() (update) to cancel the requested operation.



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to