-->
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: Map table without pk
PostPosted: Tue Jun 06, 2006 9:05 am 
Newbie

Joined: Tue May 10, 2005 10:54 am
Posts: 16
Location: Italy
Hi,
I'm sorry for my English, but I can't speak English very well.

I must map a particular table: there isn't a pk!
It is a log table!
I've try to map the table but <id> is required!

How can I map this table?
Or must I alter the table? Must I add a Pk?

Thanks everybody :-)
Mary


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 06, 2006 9:22 am 
Beginner
Beginner

Joined: Thu Sep 01, 2005 7:43 am
Posts: 31
Location: León (Spain)
Every table in a database has a PK. If none of your columns (or a subset of your columns) distinguishes uniquely a row, the combination of all the columns will be the PK.

So, yes, you need a PK, but you can stablish it as you wish.

Hope it helps.

_________________
Please rate...

Expert on Hibernate errors... I've had them all... :P


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 06, 2006 9:29 am 
Newbie

Joined: Tue May 10, 2005 10:54 am
Posts: 16
Location: Italy
I've forgot this...
Thanks very much Hector

Hector_Lopez wrote:
Every table in a database has a PK. If none of your columns (or a subset of your columns) distinguishes uniquely a row, the combination of all the columns will be the PK.

So, yes, you need a PK, but you can stablish it as you wish.

Hope it helps.


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.