aspose file tools*
The moose likes Object Relational Mapping and the fly likes insert does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "insert does not work" Watch "insert does not work" New topic
Author

insert does not work

Diego Garcia
Greenhorn

Joined: Sep 14, 2004
Posts: 16
Hi everyone,

I am trying to make an insert but nothing happens in my database. This is my User class:





my mapping file:





this is my insert makePersistent() method:




Can someone help me? Any idea of what is going on?

Thanks in advance
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Where do you begin the transaction?

Any SQL in your console output? Any error messages?




-Cameron McKenzie
Diego Garcia
Greenhorn

Joined: Sep 14, 2004
Posts: 16
Hi again,

Thanks for the response, Cameron.

Here is where i begin the transaction:



and the constructor in WebUserDAO:



and my hibernate generated sql:


Any idea? Thanks again

[ June 26, 2008: Message edited by: Diego Garcia ]

[ June 26, 2008: Message edited by: Diego Garcia ]
[ June 26, 2008: Message edited by: Diego Garcia ]
Diego Garcia
Greenhorn

Joined: Sep 14, 2004
Posts: 16
Hello everyone,

I am still stuck at this...i have been reading and i have a question:

Could it be possible that i need a version element added to the mapping file (and a version instance variable)?

Any thoughts? thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Only if you want to use Hibernate's optimistic locking mechanism. It is optional.

Where do you commit your transaction?
[ July 08, 2008: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Diego Garcia
Greenhorn

Joined: Sep 14, 2004
Posts: 16
Thanks Paul, for your interest.

I commit my transaction in my makePersistent() method:



[ July 08, 2008: Message edited by: Diego Garcia ]
[ July 08, 2008: Message edited by: Diego Garcia ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: insert does not work