10fbfc30aSopenharmony_ci/** 20fbfc30aSopenharmony_ci * @file Describe the file 30fbfc30aSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 40fbfc30aSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 50fbfc30aSopenharmony_ci * you may not use this file except in compliance with the License. 60fbfc30aSopenharmony_ci * You may obtain a copy of the License at 70fbfc30aSopenharmony_ci * 80fbfc30aSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 90fbfc30aSopenharmony_ci * 100fbfc30aSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 110fbfc30aSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 120fbfc30aSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130fbfc30aSopenharmony_ci * See the License for the specific language governing permissions and 140fbfc30aSopenharmony_ci * limitations under the License. 150fbfc30aSopenharmony_ci */ 160fbfc30aSopenharmony_ci 170fbfc30aSopenharmony_ciimport data_rdb from '@ohos.data.relationalStore'; 180fbfc30aSopenharmony_ciimport DataShareResultSet from '@ohos.data.DataShareResultSet'; 190fbfc30aSopenharmony_ciimport { CalendarAlertsColumns } from './CalendarAlertsColumns'; 200fbfc30aSopenharmony_ci 210fbfc30aSopenharmony_ciinterface CalendarAlertsType { 220fbfc30aSopenharmony_ci idIndex: number; 230fbfc30aSopenharmony_ci eventIdIndex: number; 240fbfc30aSopenharmony_ci beginIndex: number; 250fbfc30aSopenharmony_ci endIndex: number; 260fbfc30aSopenharmony_ci alarmTimeIndex: number; 270fbfc30aSopenharmony_ci creationTimeIndex: number; 280fbfc30aSopenharmony_ci receivedTimeIndex: number; 290fbfc30aSopenharmony_ci notifyTimeIndex: number; 300fbfc30aSopenharmony_ci stateIndex: number; 310fbfc30aSopenharmony_ci minutesIndex: number; 320fbfc30aSopenharmony_ci creatorIndex: number; 330fbfc30aSopenharmony_ci} 340fbfc30aSopenharmony_ci 350fbfc30aSopenharmony_ci/** 360fbfc30aSopenharmony_ci * the columns indexes for table CalendarAlerts 370fbfc30aSopenharmony_ci * 380fbfc30aSopenharmony_ci * @since 2022-09-19 390fbfc30aSopenharmony_ci */ 400fbfc30aSopenharmony_ciexport class CalendarAlertsIndexes implements CalendarAlertsType { 410fbfc30aSopenharmony_ci idIndex = 0; 420fbfc30aSopenharmony_ci eventIdIndex = 0; 430fbfc30aSopenharmony_ci beginIndex = 0; 440fbfc30aSopenharmony_ci endIndex = 0; 450fbfc30aSopenharmony_ci alarmTimeIndex = 0; 460fbfc30aSopenharmony_ci creationTimeIndex = 0; 470fbfc30aSopenharmony_ci receivedTimeIndex = 0; 480fbfc30aSopenharmony_ci notifyTimeIndex = 0; 490fbfc30aSopenharmony_ci stateIndex = 0; 500fbfc30aSopenharmony_ci minutesIndex = 0; 510fbfc30aSopenharmony_ci creatorIndex = 0; 520fbfc30aSopenharmony_ci} 530fbfc30aSopenharmony_ci 540fbfc30aSopenharmony_ci/** 550fbfc30aSopenharmony_ci * parse all indexes for table CalendarAlerts 560fbfc30aSopenharmony_ci * 570fbfc30aSopenharmony_ci * @param resultSet the result from somewhere rdb.query 580fbfc30aSopenharmony_ci */ 590fbfc30aSopenharmony_ciexport function parseCalendarAlertsIndexes(resultSet: data_rdb.ResultSet): CalendarAlertsIndexes | undefined { 600fbfc30aSopenharmony_ci if (resultSet === null || resultSet === undefined) { 610fbfc30aSopenharmony_ci return undefined; 620fbfc30aSopenharmony_ci } 630fbfc30aSopenharmony_ci let indexes: CalendarAlertsIndexes = new CalendarAlertsIndexes(); 640fbfc30aSopenharmony_ci indexes.idIndex = resultSet.getColumnIndex(CalendarAlertsColumns.ID); 650fbfc30aSopenharmony_ci indexes.eventIdIndex = resultSet.getColumnIndex(CalendarAlertsColumns.EVENT_ID); 660fbfc30aSopenharmony_ci indexes.beginIndex = resultSet.getColumnIndex(CalendarAlertsColumns.BEGIN); 670fbfc30aSopenharmony_ci indexes.endIndex = resultSet.getColumnIndex(CalendarAlertsColumns.END); 680fbfc30aSopenharmony_ci indexes.alarmTimeIndex = resultSet.getColumnIndex(CalendarAlertsColumns.ALARM_TIME); 690fbfc30aSopenharmony_ci indexes.creationTimeIndex = resultSet.getColumnIndex(CalendarAlertsColumns.CREATION_TIME); 700fbfc30aSopenharmony_ci indexes.receivedTimeIndex = resultSet.getColumnIndex(CalendarAlertsColumns.RECEIVED_TIME); 710fbfc30aSopenharmony_ci indexes.notifyTimeIndex = resultSet.getColumnIndex(CalendarAlertsColumns.NOTIFY_TIME); 720fbfc30aSopenharmony_ci indexes.stateIndex = resultSet.getColumnIndex(CalendarAlertsColumns.STATE); 730fbfc30aSopenharmony_ci indexes.minutesIndex = resultSet.getColumnIndex(CalendarAlertsColumns.MINUTES); 740fbfc30aSopenharmony_ci indexes.creatorIndex = resultSet.getColumnIndex(CalendarAlertsColumns.CREATOR); 750fbfc30aSopenharmony_ci return indexes; 760fbfc30aSopenharmony_ci}