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: GET and LOAD Methods
PostPosted: Mon Feb 21, 2011 1:00 am 
Newbie

Joined: Mon Feb 21, 2011 12:57 am
Posts: 2
hi a use hibernate i want use get o load method, i have many examples
but the examples the id of table or class hace ONE columns , my table have two Id columns
how to execute method get or load???
please help


Top
 Profile  
 
 Post subject: Re: GET and LOAD Methods
PostPosted: Mon Feb 21, 2011 1:04 am 
Newbie

Joined: Mon Feb 21, 2011 12:57 am
Posts: 2
this a example with a id column

User user = (User) session.load(User.class, new Long(100));

but if my table have two or tree columns id , how to execute method?????


Top
 Profile  
 
 Post subject: Re: GET and LOAD Methods
PostPosted: Mon Feb 21, 2011 2:52 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
The recommended approach is to use a component as an identifier. The first example in http://docs.jboss.org/hibernate/core/3. ... aration-id shows you how. Then you can use an instance of UserId in the get() and load() methods.


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.