Class ValidationException

  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.persistence.PersistenceException
                  extended by com.avaje.ebean.ValidationException
All Implemented Interfaces:

public class ValidationException
extends javax.persistence.PersistenceException


Exception thrown when a validation rule fails when saving a bean.

See Also:
Serialized Form

Constructor Summary
ValidationException(InvalidValue invalid)
Method Summary
 InvalidValue[] getErrors()
          Return the actual errors for all beans validated.
 InvalidValue getInvalid()
          Return the InvalidValue tree.
 String toString()
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ValidationException(InvalidValue invalid)
Method Detail


public InvalidValue getInvalid()
Return the InvalidValue tree.

This is a tree structure as validation can cascade to associated one and associated many beans.


public InvalidValue[] getErrors()
Return the actual errors for all beans validated.

This flattens the InvalidValue tree just returning the actual errors excluding the InvalidValue 'beans' that just hold errors (as children).


public String toString()
toString in class Throwable

Copyright © 2010. All Rights Reserved.