PersonTakesPartInElementInstance(
      RelationManager manager, Person subject, CourseElementInstance object, Timeslot _timeslot) {
    if (subject == null || object == null) {
      throw new IllegalArgumentException();
    }
    this.manager = manager;
    this.subject = subject;
    this.subject_refid = subject.id();
    this.object = object;
    this.object_refid = object.id();

    this._timeslot = _timeslot;
    this.ref_timeslot = _timeslot.id();
    this.fetched_timeslot = true;
  }
  ElementInstancePrefersRoom(
      RelationManager manager, CourseElementInstance subject, Room object, int _priority) {
    if (subject == null || object == null) {
      throw new IllegalArgumentException();
    }
    this.manager = manager;
    this._elementInstance = this.subject = subject;
    this.ref_elementInstance = this.subject_refid = subject.id();
    this._room = this.object = object;
    this.ref_room = this.object_refid = object.id();
    timekey(true);

    this._priority = _priority;
    this.fetched_priority = true;
  }
 @Override
 public void create() throws de.fu.weave.orm.DatabaseException {
   String query =
       "INSERT INTO "
           + "\"scetris\".\"personTakesPartInElementInstance\""
           + " (Person, CourseElementInstance, , \"timeslot\")"
           + " VALUES (?);";
   try {
     java.sql.PreparedStatement stmt =
         manager.connectionManager.getConnection().prepareStatement(query);
     stmt.setInt(1, subject.id());
     stmt.setInt(2, object.id());
     int i = 3;
     stmt.setInt(i++, ref_timeslot);
     stmt.execute();
   } catch (java.sql.SQLException e) {
     throw new de.fu.weave.orm.DatabaseException(query, e);
   }
 }