*
The moose likes Object Relational Mapping and the fly likes Hibernate MVC Can't create new Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate MVC Can Watch "Hibernate MVC Can New topic
Author

Hibernate MVC Can't create new Client

Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

I am new on Hibernate so I am going to explain it as best as I can.

I am trying Coding Advanced DAOs with Hibernate and JPA Annotations - The Pattern,

Cameron McEnzie tutorial, Coding Advanced DAOs with Hibernate and JPA Annotations - The Pattern

What I am trying is to develop it as a web app.

Here is the jsp,



I use a servlet as a controller,



And a Filter to open the org.hibernate.Session and close it every time the transaction is commited.
This filter lets maintain the session opened if necessary. The code is as follows,



This is the code snippet to create a new Client,



But it does not. In fact it creates a new empty records for the tables client, client_detail, address and skill.

And I do not know what I am doing wrong.

Any help will be appreciate!!!

Thanks in advance
Jose
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

It was a mistake of mine.

I was using request.getAttribute() instead of request.getParameter()

Regards
Jose
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm glad you discovered the error--I was having a difficult time penetrating the code. You might want to consider writing substantially smaller methods; it helps people understand what's going on.
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi David,

Thanks for your suggestion.

I know what you are meaning. Maybe I have posted information that take to confusion
and the methods are quite long.

I will remain it for the next time.


Best Regards,
Jose
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate MVC Can't create new Client