1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import featureAbility from '../@ohos.ability.featureAbility'; 17import dataAbility from '../@ohos.data.dataAbility'; 18import rdb from '../@ohos.data.rdb'; 19 20 /** 21 * @since 7 22 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 23 * @permission N/A 24 */ 25export interface DataAbilityOperation { 26 /** 27 * Indicates the path of data to operate. 28 * @default - 29 * @since 7 30 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 31 * @FAModelOnly 32 */ 33 uri: string; 34 35 /** 36 * Indicates a operation type. 37 * @default - 38 * @since 7 39 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 40 * @FAModelOnly 41 */ 42 type: featureAbility.DataAbilityOperationType; 43 44 /** 45 * Indicates the data values to be set. 46 * @default - 47 * @since 7 48 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 49 * @FAModelOnly 50 */ 51 valuesBucket?: rdb.ValuesBucket; 52 53 /** 54 * Indicates the valuesBucket object containing a set of key-value pairs. 55 * @default - 56 * @since 7 57 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 58 * @FAModelOnly 59 */ 60 valueBackReferences?: rdb.ValuesBucket; 61 62 /** 63 * Indicates the filter criteria to set. If this parameter is null, all data records 64 * will be operated by default. 65 * @default - 66 * @since 7 67 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 68 * @FAModelOnly 69 */ 70 predicates?: dataAbility.DataAbilityPredicates; 71 72 /** 73 * Indicates the back reference to be used as a filter criterion in predicates. 74 * @default - 75 * @since 7 76 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 77 * @FAModelOnly 78 */ 79 predicatesBackReferences?: Map<number, number>; 80 81 /** 82 * Specifies whether a batch operation can be interrupted. 83 * @default - 84 * @since 7 85 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 86 * @FAModelOnly 87 */ 88 interrupted?: boolean; 89 90 /** 91 * Indicates the expected number of rows to update or delete. 92 * @default - 93 * @since 7 94 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 95 * @FAModelOnly 96 */ 97 expectedCount?: number; 98}