-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: noob question: Hibernate + JSF?
PostPosted: Sun Jan 08, 2006 5:14 pm 
Newbie

Joined: Sun Jan 08, 2006 4:53 pm
Posts: 6
I'm just starting to look into using the JSF framework, and I'm a little confused about how Hibernate is meant to be integrated into my code.

From what I understand, Hibernate is meant to load data from a database and make it available as Java objects (i.e. POJOs), and then save any changes in their state back to the database. So for example, you would have a "User" object (corresponding to a row of data in the database), and a "UserController" class for dealing with these User objects (i.e. loading them via the Hibernate API, creating new Users, saving changes, etc.). In other words the User object doesn't contain any calls to the Hibernate API. You do all of that in your UserController.

However, under JSF, it seems like your JSP pages need to deal with the "User" bean directly. If you have a form where you want to display the User's information, you use the User object directly. When you submit the changes, the User object is updated. i.e., the User object's setUsername() (or whatever) method is called, and it is expected that database-related calls (i.e. Hibernate API calls) will be made inside User's setUsename() method. There is no room for a UserController here!

All of this makes sense to me under Tapestry, but I am really confused about how this is meant to work under JSF.

Sorry if this is a trivial question. Coming from Rails, I'm finding the Java web world to be a surprisingly confusing mess of competing frameworks, buzzwords, and acronyms :(


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 08, 2006 7:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Take a look at the "noejb" example that comes with Seam.

http://jboss.com/products/seam


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.