cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Cayenne validation
Date Wed, 14 Mar 2007 19:45:39 GMT
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 <syrinx2004@gmail.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.
>
>

Mime
View raw message