[jboss-user] [JBoss Seam] - Re: Overriding EntityHome.persist problems

petemuir do-not-reply at jboss.com
Fri Mar 9 20:32:48 EST 2007


"MikeDougherty" wrote : I've got some rules that will validate an entity before it is saved to the database, according to what I've read the best place to do that is in the Home.persist method. 

Yup, that would be my plan (and in the update method as well if needed)

anonymous wrote : However, in the Home.persist method the getId and getInstance methods always return null. I expected them to contain the Entity that is about to be persisted, is this not a correct assumption?

Well, getId() would return null right (as the database has not yet assigned an id)?  But getInstance should return the entity you completed on the form.  Post the code/wiring you are using.

anonymous wrote : I injected an instance of the Entity and it seems to contain the form data. This works, and I'm cool with, but is this the *right* way?

Not as neat, but still fine IMO.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026818#4026818

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026818



More information about the jboss-user mailing list