[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-4057) Add static method EntityHome.wrapInstance and add location for update/persist processing
Pete Muir (JIRA)
jira-events at lists.jboss.org
Mon Mar 30 18:00:22 EDT 2009
[ https://jira.jboss.org/jira/browse/JBSEAM-4057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12459749#action_12459749 ]
Pete Muir commented on JBSEAM-4057:
-----------------------------------
wrapInstance - this is not functionality we want.
catch InvalidStateException - this could be useful, please raise an individual JIRA for this
> 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,diff, 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