File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate Insert - help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Insert - help" Watch "Hibernate Insert - help" New topic
Author

Hibernate Insert - help

G.Sathish kumar
Ranch Hand

Joined: Jul 27, 2009
Posts: 84
I used hibernate for one of my project in my old company without association

i heared about auto generation tools there in the eclipse so i try to generate the mappling and do code but in the final when i try to the both table it is not working
here i added the codes i am using

please check and let me know if i am wrong anywhere


Thanks
Sathish kumar
SCJP, SCWCD
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


it is not working

It's hard to help without knowing a bit more. What is not working? How is it not working? Is there any error message? If not, how is it behaving differently from what you expect?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
G.Sathish kumar
Ranch Hand

Joined: Jul 27, 2009
Posts: 84
Paul Sturrock wrote:

it is not working

It's hard to help without knowing a bit more. What is not working? How is it not working? Is there any error message? If not, how is it behaving differently from what you expect?


when i try to insert the new object for bank with the pull of one user object is not getting saved in the database.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Where do you commit your transaction?
G.Sathish kumar
Ranch Hand

Joined: Jul 27, 2009
Posts: 84
Paul Sturrock wrote:Where do you commit your transaction?
i am not using transaction

on save i am calling getSession().save(p1); p1 is the object of bank and i try to see in the db end but i am not able to see it saved
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If you are using a database you are always using a transaction. In order to use Hibernate without explicitly declaring a transation you will need to make the session auto-commit.
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Paul Sturrock wrote:In order to use Hibernate without explicitly declaring a transation you will need to make the session auto-commit.


Or if you use EJBs, enable CMT.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Insert - help
 
Similar Threads
problem with hibernate
Hibernate Issue
Hibernate Association
Hibernate insert
Hibernate Association