コード例 #1
0
 private void validateDates(AcScheduledFlightUploadErrorVo e) {
   AcScheduledFlightUpload u = e.getScheduledFlightUpload();
   if (!u.hasStartLocalDt()) return;
   if (!u.hasEndLocalDt()) return;
   if (u.getStartLocalDt().isAfter(u.getEndLocalDt()))
     e.addError("Invalid Start/End date combination");
 }
コード例 #2
0
 public AcScheduledFlightUpload read(JwSqlResultSet rs) {
   AcScheduledFlightUpload e;
   e = getAccess().newScheduledFlightUpload();
   e.setId(rs.getInteger());
   e.setOperatorCarrierCode(rs.getString());
   e.setOperatorNumber(rs.getString());
   e.setRelationship(AcFlightRelationshipEnum.getFromCode(rs.getString()));
   e.setOriginAirportCode(rs.getString());
   e.setDestinationAirportCode(rs.getString());
   e.setDepartureLocalTm(rs.getTime());
   e.setArrivalLocalTm(rs.getTime());
   e.setDayOffset(rs.getInteger());
   e.setBoundingStartLocalDt(rs.getDate());
   e.setBoundingEndLocalDt(rs.getDate());
   e.setFrequency(rs.getDayFrequency());
   e.setEquipmentCode(rs.getString());
   e.setSource(AcScheduledFlightCalendarSourceEnum.getFromCode(rs.getString()));
   e.setAbsoluteSource(AcScheduledFlightCalendarAbsoluteSourceEnum.getFromCode(rs.getString()));
   e.setCancel(rs.getBoolean());
   e.setCreatedUtcTs(rs.getTimestamp());
   e.setSequence(rs.getInteger());
   return e;
 }
コード例 #3
0
 public JwSqlUpdate composeUpdate(AcScheduledFlightUpload e) {
   JwSqlUpdate st = createUpdate();
   st.setTable(TABLE);
   st.setValue(OPERATOR_CARRIER_CODE, e.getOperatorCarrierCode());
   st.setValue(OPERATOR_NUMBER, e.getOperatorNumber());
   st.setValue(RELATIONSHIP, e.getRelationship().getCode());
   st.setValue(ORIGIN_AIRPORT_CODE, e.getOriginAirportCode());
   st.setValue(DESTINATION_AIRPORT_CODE, e.getDestinationAirportCode());
   st.setValue(DEPARTURE_LOCAL_TM, e.getDepartureLocalTm());
   st.setValue(ARRIVAL_LOCAL_TM, e.getArrivalLocalTm());
   st.setValue(DAY_OFFSET, e.getDayOffset());
   st.setValue(BOUNDING_START_LOCAL_DT, e.getBoundingStartLocalDt());
   st.setValue(BOUNDING_END_LOCAL_DT, e.getBoundingEndLocalDt());
   st.setValue(FREQUENCY, e.getFrequency());
   st.setValue(EQUIPMENT_CODE, e.getEquipmentCode());
   st.setValue(SOURCE, e.getSource().getCode());
   st.setValue(ABSOLUTE_SOURCE, e.hasAbsoluteSource() ? e.getAbsoluteSource().getCode() : null);
   st.setValue(CANCEL, e.getCancel());
   st.setValue(CREATED_UTC_TS, e.getCreatedUtcTs());
   st.setValue(SEQUENCE, e.getSequence());
   st.where().isEqual(ID, e.getId());
   return st;
 }
コード例 #4
0
 public void update(AcScheduledFlightUpload e) {
   e.validate();
   JwSqlUpdate st = composeUpdate(e);
   int i = execute(st);
   if (i != 1) error("Unable to update AcScheduledFlightUpload.  Rows updated: %s.", i);
 }
コード例 #5
0
 public void generateIds(JwList<AcScheduledFlightUpload> v) {
   Integer i = getNextId();
   for (AcScheduledFlightUpload e : v) e.setId(i++);
 }
コード例 #6
0
  public JwSqlInsert _checkAndComposeInsert(JwList<AcScheduledFlightUpload> v, boolean insertIds) {
    for (AcScheduledFlightUpload e : v) {
      defaultUpdateCount(e);
      e.validate();
      verifyNoMatching(e);
    }

    JwSqlInsert st = createInsert();
    st.setTable(TABLE);
    populateInsertColumns(st, insertIds);

    for (AcScheduledFlightUpload e : v) {
      st.startNewRow();
      if (insertIds) st.addIntegerValue(e.getId());
      st.addStringValue(e.getOperatorCarrierCode());
      st.addStringValue(e.getOperatorNumber());
      st.addStringValue(e.getRelationship().getCode());
      st.addStringValue(e.getOriginAirportCode());
      st.addStringValue(e.getDestinationAirportCode());
      st.addTimeValue(e.getDepartureLocalTm());
      st.addTimeValue(e.getArrivalLocalTm());
      st.addIntegerValue(e.getDayOffset());
      st.addDateValue(e.getBoundingStartLocalDt());
      st.addDateValue(e.getBoundingEndLocalDt());
      st.addDayFrequencyValue(e.getFrequency());
      st.addStringValue(e.getEquipmentCode());
      st.addStringValue(e.getSource().getCode());
      st.addStringValue(e.hasAbsoluteSource() ? e.getAbsoluteSource().getCode() : null);
      st.addBooleanValue(e.getCancel());
      st.addTimestampValue(e.getCreatedUtcTs());
      st.addIntegerValue(e.getSequence());
    }
    return st;
  }