You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Vamsee Kanakala <va...@gmail.com> on 2005/03/15 12:11:01 UTC

Several dumb questions

Hello,

This is more of a database design question than an ibatis question, I 
hope you guys don't mind :) Here goes:

I have a table called students, and students can be assigned to several 
batches ('course' would be a better name, I think). So, I'm using a 
students_batches_map which basically contains  and id(primary key), 
student_id and batch_id.

First of all, is this a good idea? Is there any better way I can express 
such a relation? Second, if I have to update the number of batches a 
student is associated with, I can think of only one way: drop all 
batches a student is associated with and insert new selections again. 
Again, is this a good idea?

Finally, I'm having to iterate through the list of batches and insert 
each record into the students_batches_map. Is there a better way?

TIA,
Vamsee.