[
http://jira.jboss.com/jira/browse/JBSEAM-1530?page=all ]
Pete Muir closed JBSEAM-1530.
-----------------------------
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
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