-->
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.  [ 4 posts ] 
Author Message
 Post subject: getGeneratedKeys()
PostPosted: Wed Apr 28, 2004 12:08 am 
Regular
Regular

Joined: Tue Mar 23, 2004 2:10 am
Posts: 51
Hello,
While reading the changelog of hibernate 2.1.3 i came to know taht hibernate supports getGeneratedKeys() method of JDBC3 from verion 2.1.2. As i got no information about using this in documentation so please tell me how to use getGenerated Keys in hibernate does this is mentioned in mapping file or elsewhere?
Please tell me the details withj some example code

Thanks,
Shoaib Akhtar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 28, 2004 1:39 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Check the API documentation, net.sf.hibernate.config.Environment. I'll add it to the reference.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: around line 345 of hibernate.properties
PostPosted: Wed Apr 28, 2004 2:16 pm 
Newbie

Joined: Mon Mar 29, 2004 7:10 pm
Posts: 16
Location: Minneapolis, MN/Topeka, KS
Around line 345 of hibernate.properties,

Code:
## use JDBC 3 PreparedStatement.getGeneratedKeys to get the identifier of an inserted row

hibernate.jdbc.use_get_generated_keys=false


In your case, you probably want to leave it true.

_________________
Michael McConnell


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 28, 2004 10:53 pm 
Regular
Regular

Joined: Tue Mar 23, 2004 2:10 am
Posts: 51
Thankyou. It solved my problem.

Regards,
Shoaib Akhtar


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