2 Replies Latest reply on Jul 1, 2002 11:40 AM by nqin

    link-table mapping for CMP relationship

    nqin Newbie

      foreign key and link-table can mapping relationship. But I got a problem here. I have a table -class, a table - student. I want to create a table called classMember. classMember will have three columns: classid, studentid and classRole. And (classid, studentid) should be the compound key for this table. If I use link-table to create this classMember table, I can map classid to class table and studentid to student, but how and where I declare my classRole column.
      If I use foreign key mapping to map class-classMember and student-classMember. I got another problem. cmr field should be setted in ejbPostCreate and could be null. But I want the (classid, studentid) to be primary key, then they have to be setted in ejbCreate.