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
|