-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to map a table without primary key
PostPosted: Mon Mar 15, 2004 11:04 am 
Beginner
Beginner

Joined: Tue Sep 09, 2003 5:28 pm
Posts: 33
Location: Cincinnati, OH
Hi there,

I have two tables, and I just want to use read only cache on them. However, these two tables do not have primary keys, anyone know how to solve this problem?

I am using the Hibernate 2.1

Thanks so much!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 11:07 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Maybe use coposite key on all attributes ????

can you have the same row twice?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 12:30 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 5:28 pm
Posts: 33
Location: Cincinnati, OH
Thank you delpouve for the reply.

We'll never have the same row twice, so I am able to use composite id.

Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 12:47 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i think you'll have overhead using such a composite id, but try it.
Don't forget equals/hashcode, note that you musn't use all the composites id attributes to write these method, only use "business" identity

Anthony


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