Validation function/procedure

Hi all,

if it possible to declare a specific procedure/function by the post operations to do a special validation of this entry class bevor saving in the database?

For example
[entry]
x = class
private
[validator]
procedure validate;
...

Result can be a return code (by function) or an exception, which will stop the storing of the values into the database.

This is important, because not all validations can be done on database level.