-->
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: Can I use a column of comma delimited ids as FKs?
PostPosted: Thu Mar 04, 2004 11:09 pm 
Newbie

Joined: Thu Mar 04, 2004 9:38 pm
Posts: 4
Is there anyway in hibernate to process a column of comma delimited FKs in the same manner as if there were a many-to-many linkage table? That is, ideally I could reuse some old table structures that heavily use comma delimited lists instead of creating new join tables everywhere.

Oversimplified Example:

Code:
Table: STUDENTS
id int(4) PK
name varchar(50)
professors text

Table: PROFESSORS
id int(4)
name varchar(50)



Sample data:

Code:
STUDENTS:
ID      NAME      PROFESSORS
---     -------      -------------
1        Charles     101,102


PROFESSORS:
ID      NAME
---      ------
101     Dr. John
102     Dr. Bob


Thanks,
Thad


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 1:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, you can use a custom type.

Note that this is an incredibly evil database schema, you should change it to something sane.


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.