-->
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: PK in tables
PostPosted: Wed Mar 17, 2004 1:35 pm 
Newbie

Joined: Wed Mar 17, 2004 1:22 pm
Posts: 1
Location: Warsaw/Poland
Hi!

I know that this could be a little boring to You ;) but is possible to use Hibernate on tables without PK? Tables was designed without it and now I have a problem with this. The biggest table have 56 fields (not my design ;) so hand-made objects are dificult to create. I've tried to do so but HB descriptor requires ID field - and I cannot refator database ... any ideas or maybe ways to fix it up (without adding additional fields)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 1:41 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Write a SQL query that detects duplicates and filters them, then insert the result into a cleaned up table with a surrogate primary key field. Hibernate can not use this table, it would be actually dangerous to use it for critical data.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 1:49 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Yes, it is better to fix error than to find some workaround and it is never too late to add primary key .


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.