Re: Cayenne validation

From: Mike Kienenberger (mkienen..mail.com)
Date: Wed Mar 14 2007 - 15:45:39 EDT

  • Next message: syrinx: "Re: [s] Cayenne validation"

    You haven't said how you want to use it, but at the most basic level,
    you could catch the ValidationExceptionand rethrow it with a new
    message based on the original message.

    On 3/14/07, syrinx <syrinx200..mail.com> wrote:
    >
    > Hello,
    >
    > I have just started "playing around" with Cayenne a couple weeks ago, so in
    > other words I am a rookie. I am happy with the product so far, but I cannot
    > figure out how to use the data validation properly.
    >
    > For example, if I try to commit an object with a missing "mandatory field",
    > I get a ValidationException. From that exception I can access a
    > BeanValidationFailure object which contains the details of the validation
    > error (description, source, attribute). The thing is that I would like to
    > change the generic error messages (ex: field cannot be empty, field exceeds
    > maximum allowed length) thrown by cayenne and these messages seem to be hard
    > coded in the sources.
    >
    > Is there a "clean way" to customize those messages?
    >
    > Thanks for your help.
    > --
    > View this message in context: http://www.nabble.com/Cayenne-validation-tf3404355.html#a9481842
    > Sent from the Cayenne - User mailing list archive at Nabble.com.
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Mar 14 2007 - 15:46:05 EDT