[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1530) Seam-gen: @Length in char(1) property

Raj Shetty (JIRA) jira-events at lists.jboss.org
Wed May 28 10:59:49 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBSEAM-1530?page=comments#action_12414589 ] 
            
Raj Shetty commented on JBSEAM-1530:
------------------------------------

Can anybody confirm that this patch has been released ? Which version of hibernate validator? I am facing the same issue where the validator @length fails for char data types.

> Seam-gen: @Length in char(1) property
> -------------------------------------
>
>                 Key: JBSEAM-1530
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1530
>             Project: Seam
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3.0.ALPHA
>            Reporter: Luiz Augusto Ruiz
>         Assigned To: Dan Allen
>             Fix For: 2.0.1.CR1
>
>         Attachments: JBSEAM-1530-v1.txt
>
>
> Seam-gen put a @Length Hibernate validator in char property. When a field of a table is CHAR(1) Hibernate generates a char property and seam-gen put a @Length(size=1).
> This can be fixed updating the template pojo/GetPropertyAnnotation.ftl:
> <#include "Ejb3PropertyGetAnnotation.ftl"/>
> <#if !property.optional>
>     @${pojo.importType("org.hibernate.validator.NotNull")}
> </#if>
> <#if property.columnSpan==1>
> <#assign column = property.getColumnIterator().next()/>
> <#if !c2h.isManyToOne(property) && !c2h.isTemporalValue(property) && column.length!=255 && column.length!=1>
>     @${pojo.importType("org.hibernate.validator.Length")}(max=${column.length?c})
> </#if>
> </#if>
> " && column.length!=1" fix the bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list