[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-4057) Add static method EntityHome.wrapInstance and add location for update/persist processing

Norman Richards (JIRA) jira-events at lists.jboss.org
Mon Mar 30 17:02:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-4057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12459725#action_12459725 ] 

Norman Richards commented on JBSEAM-4057:
-----------------------------------------

I don't understand what problem you are trying to solve.  Could you explain the problem you are seeing and why you your solution is general enough to be added to seam-gen.  I can't figure out what you are getting at from this JIRA.

> Add static method EntityHome.wrapInstance and add location for update/persist processing
> ----------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-4057
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4057
>             Project: Seam
>          Issue Type: Feature Request
>          Components: Tools
>    Affects Versions: 2.1.1.GA
>         Environment: Any
>            Reporter: Valerie Griffin
>         Attachments: EntityHome.java.ftl
>
>
> Constructing an EntityHome object really doesn't provide a completely-initialized object. I needed to create EntityHome objects around existing @Entity objects. Once created, these objects can be saved in the database. I created a new static method in the code generated by EntityHome. It's called wrapInstance and , in use, is defined as:
> static public MyTblHome wrapInstance(MyTbl dat);
> If there's an id in the MyTbl instance, it is used. Otherwise, an id is created and used.
> I also changed update and persist:
> If we get there with a null instance, it's an error so we return "invalid".
> There are commented locations for pre- and post-update code. For example, the code can automatically save the ID of the user performing an update.
> There's a catch for validation errors (hibernate InvalidStateException instances). If one is found, all InvalidValue lines are logged and captured foe message output.

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