-->
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.  [ 3 posts ] 
Author Message
 Post subject: doubt regarding session.load
PostPosted: Wed Dec 05, 2007 5:26 am 
Newbie

Joined: Tue Nov 27, 2007 7:53 am
Posts: 5
Suppose I have an Object of class Table which has

id and name together as a primary key (i.e composite key)

can i load this object using session.load.
If so how....

Kindly help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 7:49 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
No, you cannot do, as load method takes only one argument towards it.

You could use HQL or Criteria to retrieve the values.

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 10, 2007 5:36 am 
Newbie

Joined: Tue Nov 27, 2007 7:53 am
Posts: 5
hi its possible

Session dmsSession=null;
ZoneDataObject zone=new ZoneDataObject();
zone.setSmId(smId); //composite keys
zone.setName(zoneMoName);
try
{
dmsSession=HibernateDBSessionFactory.dmsSession();
dmsSession.beginTransaction();
zone=(ZoneDataObject)dmsSession.load(ZoneDataObject.class,zone);
}


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