Re: Cayenne validation

2007-03-15 Thread Mike Kienenberger
t; >> if (getLastName() == null || getLastName().trim().length() == 0) { >> result.addFailure(ValidationFailure.validationFailure(this, >> Student.LAST_NAME_PROPERTY, >> "You must enter a student last name.")); >> } >> >> Ari Maniatis >> >> >> --> >> Aristedes Maniatis >> phone +61 2 9660 9700 >> PGP fingerprint 08 57 20 4B 80 69 59 E2 A9 BF 2D 48 C2 20 0C C8 >> >> >> > > -- View this message in context: http://www.nabble.com/Cayenne-validation-tf3404355.html#a9496912 Sent from the Cayenne - User mailing list archive at Nabble.com.

Re: Cayenne validation

2007-03-15 Thread syrinx
want. >> >> if (getLastName() == null || getLastName().trim().length() == 0) { >> result.addFailure(ValidationFailure.validationFailure(this, >> Student.LAST_NAME_PROPERTY, >> "You must enter a student last name.")); >> } >> >>

Re: Cayenne validation

2007-03-14 Thread Malcolm Edgar
One of the great features of Cayenne is that you can get this object meta data, and enhance your UI so that it is aware of these constraints. See the method: setObjEntityFieldConstrains(String, ObjEntity) for an example: http://svn.sourceforge.net/viewvc/click/trunk/click/extras/src/net/sf/clic

Re: Cayenne validation

2007-03-14 Thread Aristedes Maniatis
On 15/03/2007, at 6:38 AM, syrinx wrote: 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, attribu

Re: [s] Cayenne validation

2007-03-14 Thread syrinx
(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. >

Re: [s] Cayenne validation

2007-03-14 Thread Mike Kienenberger
m 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://ww

Re: Cayenne validation

2007-03-14 Thread Mike Kienenberger
es 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.

Cayenne validation

2007-03-14 Thread syrinx
eeds 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 t