[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2299) Seam Generate Entities creates edit field for @Version annotated fields

Dan Allen (JIRA) jira-events at lists.jboss.org
Thu Nov 29 01:46:46 EST 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-2299?page=all ]

Dan Allen updated JBSEAM-2299:
------------------------------

    Attachment: JBSEAM-2299-v1.txt

I can confirm that this happens when you run the following sequence of seam-gen commands:

./seam new-entity
./seam generate-ui

The UI generation is blind to the version property and unknowningly creates an input field for it. I have attached a patch which excludes the input field if the property is the version property, which is available on POJOClass

<#if property != pojo.versionProperty>
<#include "editproperty.xhtml.ftl">
</#if>

That, at least, fixes the breakage. Now the question is, should we hide the version property all together? That is another issue entirely. I am thinking we probably should. In that case, this logic is going to have to be applied deeper. But it is easy to do if you like looking a FreeMarker templates all day.

> Seam Generate Entities creates edit field for @Version annotated fields
> -----------------------------------------------------------------------
>
>                 Key: JBSEAM-2299
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2299
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.0.0.GA
>            Reporter: Thorsten Kunz
>            Priority: Minor
>         Attachments: JBSEAM-2299-v1.txt
>
>
> When you have an entity with a @Version annotation present (which is the default if you create it with "Seam Entity") and then run "Seam Generate Entities" on the project and select "use existing entities" the resulting CRUD pages will allow the version field to be edited. So you won't be able to create entities because the set accessor for the version was declared private in the entity. This renders the CRUD pages useless.
> I think this field should not be editable in the first place.
> Cheers, Thorsten

-- 
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