-->
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.  [ 3 posts ] 
Author Message
 Post subject: Servlet for Hibernate Reference Documentation (3.0.5)
PostPosted: Wed Mar 22, 2006 4:54 pm 
Newbie

Joined: Wed Mar 22, 2006 4:46 pm
Posts: 9
Hi,

I am extremely new to this concept provided by Hibernate but have gone through the Hibernate Reference Documentation (version 3.0.5) along with a little bit of Hibernate In Action. I am attempting to generate a Java Servlet to go along with the reference documentation's simple cat example (in chapter 1) and am not having any success at all. Is there an example of this type of simple Hibernate implementation with an appropriate Servlet somewhere that I can take a look at for reference?

Thanks,

New to Hibernate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 6:59 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Well, what classes do you have so far? A model object? An associated mapping file? The correct hibernate config file? A session factory? Some class that handles the persistence operations?

I understand that this is a test example, but try to break it up between the model, the persistence layer, and the client. I can't give u a class diagram here, but you need your client (your servlet in this case), your model (your persistent class), and the class that actually performs persistence operations (which could be your servlet, or some other class that handles update/delete operations) to operate together. The key is the Hibernate session, which is the primary connection between objects in memory vs. objects on disk.

Hope this helps a little bit

Don


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 25, 2006 5:00 pm 
Newbie

Joined: Wed Mar 22, 2006 4:46 pm
Posts: 9
Yes, so far i have the simple Cat class with getter and setter methods for each of the respective fields for the Cat database that I created in postgres as the documentation stated. Then there is the HibernateUtil class that gets the session that I am attempting to use in my CatServlet class but for some reason I cannot get the session to initialize. I keep getting the error in Tomcat that states NoClassDef found for the HibernateUtil portion that I am trying to get the current session for (from the Servlet code). I am begginning to believe that it is because I have a Tomcat configuration error in my Tomcat5.5\conf\server.xml file and am reading Tomcat documentation currently to see if this is the issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.