-->
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.  [ 8 posts ] 
Author Message
 Post subject: How to make rowid as primary key in hibernate
PostPosted: Tue Aug 16, 2011 3:05 am 
Newbie

Joined: Wed Aug 10, 2011 11:24 pm
Posts: 14
Hi all,
How to make rowid as primary key in hibernate?....Actually in my table no primary key,unique key,composite key....i am requesting to all for a quick solution.......

_________________
With Best Regards
SreenivaS
Save trees Save life


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Tue Aug 16, 2011 7:15 am 
Newbie

Joined: Tue Aug 16, 2011 6:57 am
Posts: 3
Answer available in http://www.cloudsopedia.com/tutorial/hibernate/


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Tue Aug 16, 2011 11:49 pm 
Newbie

Joined: Wed Aug 10, 2011 11:24 pm
Posts: 14
HI kundanupadhyaya,
In that link i didnt get any information regarding rowid making as a primary key...plz reply with exact link......

_________________
With Best Regards
SreenivaS
Save trees Save life


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Wed Aug 17, 2011 1:38 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
SreenivaS,
you're asking this on the wrong forum, still I'll briefly answer that what you ask is wrong to do. A ROWID is not consistent so it doesn't univocally identify an entity, it's not suited to be used as primary key. Don't do it.
I think kundanupadhyaya is right by recommending you to learn the basics as a first step.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Wed Aug 17, 2011 10:45 pm 
Newbie

Joined: Wed Aug 10, 2011 11:24 pm
Posts: 14
Hi s.grinovero,

Thanks for giving valuable suggession.Actually my problem is i dont have primary key,unique key,composite key in my table.Then how to do the mapping for tht table in hibernate..so,i thought may be we should take rowid as a primary key..Plz understand my problem and reply to me if it is having any solution?

_________________
With Best Regards
SreenivaS
Save trees Save life


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Thu Aug 18, 2011 4:32 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Thanks for giving valuable suggession.Actually my problem is i dont have primary key,unique key,composite key in my table.Then how to do the mapping for tht table in hibernate..so,i thought may be we should take rowid as a primary key..Plz understand my problem and reply to me if it is having any solution?

some options:
1) add a primary key column using a sequence to define it. At least it won't change after you have created it.
2) choose one existing column, or the combination of some, as PK
3) worst case, combine all columns as PK

I'd recommend option 1.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Thu Aug 18, 2011 5:52 am 
Newbie

Joined: Wed Aug 10, 2011 11:24 pm
Posts: 14
Hi s.grinovero ,
Thank you very much for helping me....

_________________
With Best Regards
SreenivaS
Save trees Save life


Top
 Profile  
 
 Post subject: Re: How to make rowid as primary key in hibernate
PostPosted: Thu Sep 29, 2011 6:56 am 
Newbie

Joined: Thu Sep 29, 2011 6:52 am
Posts: 1
s.grinovero, i have this problem too. I cant add pk, this is not possible now.

Is there different solutions about it ? We should set it like pk ?


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