Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using session.load with a composite identifier

 
Alberto Dousdebes
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! i have a table with a composite Id. The mappging is:


The api documentation says:
load(Class theClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.

The question is how can i get and object using the load method.???����??? (keep in mind that my object has a composite identifier).

Thanks a lot!!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to pass an instance of your composite id class with the various properties of the key populated.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!