[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-1530) Seam-gen: @Length in char(1) property
Dan Allen (JIRA)
jira-events at lists.jboss.org
Tue Jul 10 13:10:31 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1530?page=all ]
Dan Allen updated JBSEAM-1530:
------------------------------
Attachment: JBSEAM-1530-v1.txt
Actually, the correct way to do this is to check property.type.name. The correct patch has been attached.
> Seam-gen: @Length in char(1) property
> -------------------------------------
>
> Key: JBSEAM-1530
> URL: http://jira.jboss.com/jira/browse/JBSEAM-1530
> Project: JBoss Seam
> Issue Type: Bug
> Components: Tools
> Affects Versions: 1.3.0.ALPHA
> Reporter: Luiz Augusto Ruiz
> 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