On 11/3/06, Nebinger, David <[EMAIL PROTECTED]> wrote:
This works especially nicely when you have input components bound to the properties of the pojo ... JSF will push the updated values directly into your pojo (after validation, of course), so all you need to do in your action method is tell Hibernate to save the updated data. No copying of individual fields required.
Craig
The easiest method would be simply to expose a getter method on your backing bean that returns the hibernate pojo.Through EL, you can then do #{backingbean.pojo.field} w/o having to replicate your various getters/setters or include the pojo as a direct backing bean.
This works especially nicely when you have input components bound to the properties of the pojo ... JSF will push the updated values directly into your pojo (after validation, of course), so all you need to do in your action method is tell Hibernate to save the updated data. No copying of individual fields required.
Craig
-----Original Message-----I have an existing Hibernate project with many hibernate mapped POJO's.
From: Mick Knutson [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2006 4:01 PM
To: MyFaces Discussion
Subject: Best practices to add MyFaces to an existing Hibernate project
I do not want to add all the set/get methods from my POJO into Backing Beans, so I am wondering what others have done?
Have your BackingBean extend you hibernate object?
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson

