David Newton wrote:(Off-topic: are you keeping a list of the swear words the students use? ;) It's "course", not "curse" :)
Thank you for your comments! It's meaning course, of course :mrgreen:
OFF: My university have "NEPTUN" web based education system, and theme of my thesis is a same system. In NEPTUN, it's "curse"...
As James points out, editing a primary key == inserting a new record. So I'd do what he's already suggested, delete the existing records and a a new one.
This code don't create row in Users_Course... I know, if I create some new instances of UserCourse with "modifiedCourseId" courseId, rows are created.
But if this row is edited, I have to edit all instance in database, where courseId is "sub-primary key".