• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate save return id

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
If my database auto-generates the primary key as an identity column, is it possible to have Hibernate return this when I call save off the session object?

Thanks for any help,
Jehan
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate's Session.save returns the id. look in the Javadoc

http://www.hibernate.org/hib_docs/v3/api/

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic