]
Valerie Griffin updated JBSEAM-4057:
------------------------------------
Attachment: EntityHome,diff
Here's a diff, using jboss-seam-2.1.1.GA as the base
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: