-
1. Re: @Length in char(1) property
jcalienes May 23, 2007 11:37 AM (in response to luizruiz)tienes que remover la anotacion @Length, esta es solo para Strings.
juan -
2. Re: @Length in char(1) property
luizruiz May 23, 2007 2:01 PM (in response to luizruiz)Yes, removing the annotation solves the problem, but is it a bug of hibernate tools? The application created by seam-gen is not ready to use.
Luiz -
3. Re: @Length in char(1) property
gavin.king May 24, 2007 9:36 AM (in response to luizruiz)The application created by seam-gen is not ready to use.
Right, it is a starting point, not a readymade production application. -
4. Re: @Length in char(1) property
dan.j.allen Jul 10, 2007 12:40 PM (in response to luizruiz)Gavin, I appreciate your point that what seam-gen should not be deemed production ready. However, you should at least be able to perform an insert. With this annotation on the char property, the validator fails. Now, arguably the validator should not fail because a char is in fact a length of 1, but right now seam-gen has to deal with that (I guess) until Hibernate is fixed.
Where is the upstream bug report? I will be looking for it in the meantime. -
5. Re: @Length in char(1) property
dan.j.allen Jul 10, 2007 12:44 PM (in response to luizruiz)You know, as I contemplate this, I realize that whose court it belongs is a toss up. The LengthValidator returns false if the property is not a String. On the other hand, a char can only be length 1 or null. So it is a pointless validation in this case. I think the right step is for seam-gen to not put this annotation. (I can be persuaded though. It's not my project).
-
6. Re: @Length in char(1) property
dan.j.allen Jul 10, 2007 12:52 PM (in response to luizruiz)Okay, I have submitted an issue and suggested change for the Hibernate Validator. After all, java.lang.Character does satisfy @Length(max = 1). What is valid is valid. Stupid, but valid. I rest my case.
http://opensource.atlassian.com/projects/hibernate/browse/HV-33 -
7. Re: @Length in char(1) property
dan.j.allen Jul 10, 2007 12:53 PM (in response to luizruiz)"dan.j.allen" wrote:
Gavin, I appreciate your point that what seam-gen should not be deemed production ready.
Sorry, that should read "what seam-gen creates should not necessarily be sent straight to production."