01: //$Id: Validatable.java 4112 2004-07-28 03:33:35Z oneovthafew $
02: package org.hibernate.classic;
03:
04: /**
05: * Implemented by persistent classes with invariants that must
06: * be checked before inserting into or updating the database.
07: *
08: * @author Gavin King
09: */
10: public interface Validatable {
11: /**
12: * Validate the state of the object before persisting it.
13: * If a violation occurs, throw a <tt>ValidationFailure</tt>.
14: * This method must not change the state of the object by
15: * side-effect.
16: * @throws ValidationFailure if an invariant is violated
17: */
18: public void validate() throws ValidationFailure;
19: }
|