com.avaje.ebean
Class ValidationException

java.lang.Object
  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:
Serializable

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

ValidationException

public ValidationException(InvalidValue invalid)
Method Detail

getInvalid

public InvalidValue getInvalid()
Return the InvalidValue tree.

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


getErrors

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).


toString

public String toString()
Overrides:
toString in class Throwable


Copyright © 2010. All Rights Reserved.