-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to do collection mapping for this case?
PostPosted: Wed May 04, 2005 10:11 am 
Newbie

Joined: Wed May 04, 2005 9:45 am
Posts: 2
Hi all,

I'm new to Hibernate and I bumped into a problem.
I have a table that holds string data. Other tables use this table to store large string data and they hold only the corresponding ID of their entry in Strings table.

For example:

Strings table:
ID int PK,
DATA varchar(4000)

OtherTable table:
ID int PK,
NAME varchar(50),
ID_DATA int

ID_DATA is the ID of the corresponding entry in Strings table - foreign key.

I have a hard time getting this kind of association to work, there are more tables like OtherTable that use Strings table for string storage.

Basically I want the OtherTable corresponding class to have something like get/setDescription, cascade delete its entry from Strings when it is deleted.

I can't use one-to-one cause the PKs are different.

Can someone point me in the right direction?

Thanks in advance,
soso


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 10:15 am 
Newbie

Joined: Wed May 04, 2005 9:45 am
Posts: 2
Sorry, forgot about hibernate version: 3.0.2


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