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.