public static Appointment create(long initiatorId, String name,
			long venueId, long startTime, long endTime, String info,
			int frequency, long lastDay, long[] aWaitingId) throws SQLException {

		int freqHelper = Appointment.computeFreqHelper(frequency, startTime);

		Appointment rtn = new Appointment();
		rtn.initiatorId = initiatorId;
		rtn.name = name;
		rtn.venueId = venueId;
		rtn.startTime = startTime;
		rtn.endTime = endTime;
		rtn.info = info;
		rtn.frequency = frequency;
		rtn.lastDay = lastDay;
		rtn.freqHelper = freqHelper;
		if (aWaitingId != null && aWaitingId.length > 0)
		{
			rtn.isJoint = true;
			for (long waitingId : aWaitingId)
			{
				rtn.aWaitingId.add(waitingId);
			}
		}
		rtn.save();

		return rtn;
	}