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

Valerie Griffin (JIRA) jira-events at lists.jboss.org
Mon Mar 30 14:46:22 EDT 2009


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


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