(Off-topic: are you keeping a list of the swear words the students use? ;) It's "course", not "curse" :)
Hajdu Attila
Greenhorn
Joined: Mar 05, 2010
Posts: 6
posted
0
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"...
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
posted
0
What do you mean by "edit", update?
You cannot update a primary key. You should delete the UserCurse object, and add a new one to the different Curse.
For an insert, you can just create the new UserCurse and set its Id.
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".