Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Get back the object  RSS feed

 
kaushik saha
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have customer table. Its primary key will be generated by the system. When i update the customer value object using hibernate
(code follows............)

this.hibernateTemplate.saveOrUpdate(customerData);

Now i want to get back on that particular object . Actually i want the primary key of that object .(Before updation i can not get the pk. )

So what will be the HQL for getting back the object ?


kaushik


 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After the save, the customerData.getId( or whatever the primary Id is named as) should hold the generated value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!