[jbossseam-issues] [JBoss JIRA] Resolved: (JBSEAM-2947) seam-gen crud app throws exception if duplicate entry added

Dan Allen (JIRA) jira-events at lists.jboss.org
Sat Sep 20 04:10:23 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBSEAM-2947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Allen resolved JBSEAM-2947.
-------------------------------

    Fix Version/s: 2.0.3.CR2
       Resolution: Done


I came up with a nice short-term solution, which is to catch the exception in pages.xml and direct the user to the error page with a message about entering a duplicate record.

    <exception class="javax.persistence.EntityExistsException">
        <redirect view-id="/error.xhtml">
            <message severity="warn">Duplicate record</message>
        </redirect>
    </exception>

Long-term, we will want to bake a check for a duplicate record into the Home component. I have added this to my plan.

> seam-gen crud app throws exception if duplicate entry added
> -----------------------------------------------------------
>
>                 Key: JBSEAM-2947
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-2947
>             Project: Seam
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.0.2.CR2
>            Reporter: Jay Balunas
>            Assignee: Dan Allen
>             Fix For: 2.0.3.CR2, 2.1.0.CR1
>
>
> Create a seam-gen project and reverse engineer a DB (I used the tables from the release-process.txt).
> Add an new entry in one of the tables then attempt to add another identical entry ( just the primary key will do it as well).  You will see an exception (jsf error page) that basically says cannot add duplicate entry.
> Could just add a simple check instead of throwing the exception. 

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

        



More information about the seam-issues mailing list