未验证 提交 b48c0c19 编写于 作者: O openharmony_ci 提交者: Gitee

!9818 [翻译完成】#I5P1O9(格式和代码刷新,未涉及翻译)

Merge pull request !9818 from Annie_wang/PR8950
...@@ -13,13 +13,10 @@ ...@@ -13,13 +13,10 @@
import dataAbility from '@ohos.data.dataAbility'; import dataAbility from '@ohos.data.dataAbility';
``` ```
## dataAbility.createRdbPredicates ## dataAbility.createRdbPredicates
createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates
Creates an **RdbPredicates** object from a **DataAbilityPredicates** object. Creates an **RdbPredicates** object from a **DataAbilityPredicates** object.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
...@@ -32,93 +29,93 @@ Creates an **RdbPredicates** object from a **DataAbilityPredicates** object. ...@@ -32,93 +29,93 @@ Creates an **RdbPredicates** object from a **DataAbilityPredicates** object.
| dataAbilityPredicates | [DataAbilityPredicates](#dataabilitypredicates) | Yes| **DataAbilityPredicates** object. | | dataAbilityPredicates | [DataAbilityPredicates](#dataabilitypredicates) | Yes| **DataAbilityPredicates** object. |
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| rdb.[RdbPredicates](js-apis-data-rdb.md#rdbpredicates) | **RdbPredicates** object created.| | rdb.[RdbPredicates](js-apis-data-rdb.md#rdbpredicates) | **RdbPredicates** object created.|
**Example** **Example**
```js ```js
let dataAbilityPredicates = new dataAbility.DataAbilityPredicates() let dataAbilityPredicates = new dataAbility.DataAbilityPredicates()
dataAbilityPredicates.equalTo("NAME", "Rose").between("AGE", 16, 30) dataAbilityPredicates.equalTo("NAME", "Rose")
let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates) let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates)
``` ```
## DataAbilityPredicates ## DataAbilityPredicates
Provides predicates for implementing diverse query methods. Provides predicates for implementing diverse query methods.
### equalTo ### equalTo
equalTo(field: string, value: ValueType): DataAbilityPredicates equalTo(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value equal to the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value equal to the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
``` ```
### notEqualTo ### notEqualTo
notEqualTo(field: string, value: ValueType): DataAbilityPredicates notEqualTo(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value not equal to the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value not equal to the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.notEqualTo("NAME", "lisi") dataAbilityPredicates.notEqualTo("NAME", "lisi")
``` ```
### beginWrap ### beginWrap
beginWrap(): DataAbilityPredicates beginWrap(): DataAbilityPredicates
Adds a left parenthesis to this **DataAbilityPredicates**. Adds a left parenthesis to this **DataAbilityPredicates**.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with a left parenthesis.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with a left parenthesis.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
.beginWrap() .beginWrap()
...@@ -128,23 +125,22 @@ Adds a left parenthesis to this **DataAbilityPredicates**. ...@@ -128,23 +125,22 @@ Adds a left parenthesis to this **DataAbilityPredicates**.
.endWrap() .endWrap()
``` ```
### endWrap ### endWrap
endWrap(): DataAbilityPredicates endWrap(): DataAbilityPredicates
Adds a right parenthesis to this **DataAbilityPredicates**. Adds a right parenthesis to this **DataAbilityPredicates**.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with a right parenthesis.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with a right parenthesis.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "lisi") dataAbilityPredicates.equalTo("NAME", "lisi")
.beginWrap() .beginWrap()
...@@ -154,251 +150,247 @@ Adds a right parenthesis to this **DataAbilityPredicates**. ...@@ -154,251 +150,247 @@ Adds a right parenthesis to this **DataAbilityPredicates**.
.endWrap() .endWrap()
``` ```
### or ### or
or(): DataAbilityPredicates or(): DataAbilityPredicates
Adds the OR condition to this **DataAbilityPredicates**. Adds the OR condition to this **DataAbilityPredicates**.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with the OR condition.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with the OR condition.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Lisa") dataAbilityPredicates.equalTo("NAME", "Lisa")
.or() .or()
.equalTo("NAME", "Rose") .equalTo("NAME", "Rose")
``` ```
### and ### and
and(): DataAbilityPredicates and(): DataAbilityPredicates
Adds the AND condition to this **DataAbilityPredicates**. Adds the AND condition to this **DataAbilityPredicates**.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with the AND condition.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object with the AND condition.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Lisa") dataAbilityPredicates.equalTo("NAME", "Lisa")
.and() .and()
.equalTo("SALARY", 200.5) .equalTo("SALARY", 200.5)
``` ```
### contains ### contains
contains(field: string, value: string): DataAbilityPredicates contains(field: string, value: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match a string containing the specified value. Sets a **DataAbilityPredicates** object to match a string containing the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | string | Yes| Value to match the **DataAbilityPredicates**.| | value | string | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.contains("NAME", "os") dataAbilityPredicates.contains("NAME", "os")
``` ```
### beginsWith ### beginsWith
beginsWith(field: string, value: string): DataAbilityPredicates beginsWith(field: string, value: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match a string that starts with the specified value. Sets a **DataAbilityPredicates** object to match a string that starts with the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | string | Yes| Value to match the **DataAbilityPredicates**.| | value | string | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.beginsWith("NAME", "os") dataAbilityPredicates.beginsWith("NAME", "os")
``` ```
### endsWith ### endsWith
endsWith(field: string, value: string): DataAbilityPredicates endsWith(field: string, value: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match a string that ends with the specified value. Sets a **DataAbilityPredicates** object to match a string that ends with the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | string | Yes| Value to match the **DataAbilityPredicates**.| | value | string | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
``` ```
dataAbilityPredicates.endsWith("NAME", "se") dataAbilityPredicates.endsWith("NAME", "se")
``` ```
### isNull ### isNull
isNull(field: string): DataAbilityPredicates isNull(field: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field whose value is null. Sets a **DataAbilityPredicates** object to match the field whose value is null.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.isNull("NAME") dataAbilityPredicates.isNull("NAME")
``` ```
### isNotNull ### isNotNull
isNotNull(field: string): DataAbilityPredicates isNotNull(field: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field whose value is not null. Sets a **DataAbilityPredicates** object to match the field whose value is not null.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.isNotNull("NAME") dataAbilityPredicates.isNotNull("NAME")
``` ```
### like ### like
like(field: string, value: string): DataAbilityPredicates like(field: string, value: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match a string that is similar to the specified value. Sets a **DataAbilityPredicates** object to match a string that is similar to the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | string | Yes| Value to match the **DataAbilityPredicates**.| | value | string | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.like("NAME", "%os%") dataAbilityPredicates.like("NAME", "%os%")
``` ```
### glob ### glob
glob(field: string, value: string): DataAbilityPredicates glob(field: string, value: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the specified string. Sets a **DataAbilityPredicates** object to match the specified string.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | string | Yes| Value to match the **DataAbilityPredicates**.| | value | string | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.glob("NAME", "?h*g") dataAbilityPredicates.glob("NAME", "?h*g")
``` ```
### between ### between
between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match a field whose data type is **ValueType** and value is within the specified range. Sets a **DataAbilityPredicates** object to match a field whose data type is **ValueType** and value is within the specified range.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
...@@ -406,27 +398,27 @@ Sets a **DataAbilityPredicates** object to match a field whose data type is **Va ...@@ -406,27 +398,27 @@ Sets a **DataAbilityPredicates** object to match a field whose data type is **Va
| high | [ValueType](#valuetype) | Yes| Maximum value to match the **DataAbilityPredicates**.| | high | [ValueType](#valuetype) | Yes| Maximum value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.between("AGE", 10, 50) dataAbilityPredicates.between("AGE", 10, 50)
``` ```
### notBetween ### notBetween
notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value out of the specified range. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value out of the specified range.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
...@@ -434,244 +426,245 @@ Sets a **DataAbilityPredicates** object to match the field with data type **Valu ...@@ -434,244 +426,245 @@ Sets a **DataAbilityPredicates** object to match the field with data type **Valu
| high | [ValueType](#valuetype) | Yes| Maximum value to match the **DataAbilityPredicates**.| | high | [ValueType](#valuetype) | Yes| Maximum value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.notBetween("AGE", 10, 50) dataAbilityPredicates.notBetween("AGE", 10, 50)
``` ```
### greaterThan ### greaterThan
greaterThan(field: string, value: ValueType): DataAbilityPredicates greaterThan(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value greater than the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value greater than the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.greaterThan("AGE", 18) dataAbilityPredicates.greaterThan("AGE", 18)
``` ```
### lessThan ### lessThan
lessThan(field: string, value: ValueType): DataAbilityPredicates lessThan(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value less than the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value less than the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.lessThan("AGE", 20) dataAbilityPredicates.lessThan("AGE", 20)
``` ```
### greaterThanOrEqualTo ### greaterThanOrEqualTo
greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value greater than or equal to the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value greater than or equal to the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18) dataAbilityPredicates.greaterThanOrEqualTo("AGE", 18)
``` ```
### lessThanOrEqualTo ### lessThanOrEqualTo
lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value less than or equal to the specified value. Sets a **DataAbilityPredicates** object to match the field with data type **ValueType** and value less than or equal to the specified value.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.| | value | [ValueType](#valuetype) | Yes| Value to match the **DataAbilityPredicates**.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.lessThanOrEqualTo("AGE", 20) dataAbilityPredicates.lessThanOrEqualTo("AGE", 20)
``` ```
### orderByAsc ### orderByAsc
orderByAsc(field: string): DataAbilityPredicates orderByAsc(field: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the column with values sorted in ascending order. Sets a **DataAbilityPredicates** object to match the column with values sorted in ascending order.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.orderByAsc("NAME") dataAbilityPredicates.orderByAsc("NAME")
``` ```
### orderByDesc ### orderByDesc
orderByDesc(field: string): DataAbilityPredicates orderByDesc(field: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the column with values sorted in descending order. Sets a **DataAbilityPredicates** object to match the column with values sorted in descending order.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.orderByDesc("AGE") dataAbilityPredicates.orderByDesc("AGE")
``` ```
### distinct ### distinct
distinct(): DataAbilityPredicates distinct(): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to filter out duplicate records. Sets a **DataAbilityPredicates** object to filter out duplicate records.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that can filter out duplicate records.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that can filter out duplicate records.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").distinct() dataAbilityPredicates.equalTo("NAME", "Rose").distinct()
``` ```
### limitAs ### limitAs
limitAs(value: number): DataAbilityPredicates limitAs(value: number): DataAbilityPredicates
Set a **DataAbilityPredicates** object to specify the maximum number of records. Set a **DataAbilityPredicates** object to specify the maximum number of records.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | number | Yes| Maximum number of records.| | value | number | Yes| Maximum number of records.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the maximum number of records.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the maximum number of records.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").limitAs(3) dataAbilityPredicates.equalTo("NAME", "Rose").limitAs(3)
``` ```
### offsetAs ### offsetAs
offsetAs(rowOffset: number): DataAbilityPredicates offsetAs(rowOffset: number): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to specify the start position of the returned result. Sets a **DataAbilityPredicates** object to specify the start position of the returned result.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| rowOffset | number | Yes| Number of rows to offset from the beginning. The value is a positive integer.| | rowOffset | number | Yes| Number of rows to offset from the beginning. The value is a positive integer.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the start position of the returned result.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the start position of the returned result.|
**Example** **Example**
```js ```js
dataAbilityPredicates.equalTo("NAME", "Rose").offsetAs(3) dataAbilityPredicates.equalTo("NAME", "Rose").offsetAs(3)
``` ```
...@@ -679,66 +672,66 @@ Sets a **DataAbilityPredicates** object to specify the start position of the ret ...@@ -679,66 +672,66 @@ Sets a **DataAbilityPredicates** object to specify the start position of the ret
### groupBy ### groupBy
groupBy(fields: Array<string>): DataAbilityPredicates groupBy(fields: Array<string>): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to group rows that have the same value into summary rows. Sets a **DataAbilityPredicates** object to group rows that have the same value into summary rows.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| fields | Array<string> | Yes| Names of columns to group.| | fields | Array<string> | Yes| Names of columns to group.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that groups rows with the same value.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that groups rows with the same value.|
**Example** **Example**
```js ```js
dataAbilityPredicates.groupBy(["AGE", "NAME"]) dataAbilityPredicates.groupBy(["AGE", "NAME"])
``` ```
### indexedBy ### indexedBy
indexedBy(field: string): DataAbilityPredicates indexedBy(field: string): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to specify the index column. Sets a **DataAbilityPredicates** object to specify the index column.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| indexName | string | Yes| Name of the index column.| | indexName | string | Yes| Name of the index column.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the index column.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that specifies the index column.|
**Example** **Example**
```js ```js
dataAbilityPredicates.indexedBy("SALARY_INDEX") dataAbilityPredicates.indexedBy("SALARY_INDEX")
``` ```
### in ### in
in(field: string, value: Array<ValueType>): DataAbilityPredicates in(field: string, value: Array<ValueType>): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type Array<ValueType> and value within the specified range. Sets a **DataAbilityPredicates** object to match the field with data type Array<ValueType> and value within the specified range.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
...@@ -746,39 +739,40 @@ Sets a **DataAbilityPredicates** object to match the field with data type Array< ...@@ -746,39 +739,40 @@ Sets a **DataAbilityPredicates** object to match the field with data type Array<
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.in("AGE", [18, 20]) dataAbilityPredicates.in("AGE", [18, 20])
``` ```
### notIn ### notIn
notIn(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates notIn(field: string, value: Array&lt;ValueType&gt;): DataAbilityPredicates
Sets a **DataAbilityPredicates** object to match the field with data type Array<ValueType> and value out of the specified range. Sets a **DataAbilityPredicates** object to match the field with data type Array<ValueType> and value out of the specified range.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core **System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| field | string | Yes| Column name in the table.| | field | string | Yes| Column name in the table.|
| value | Array&lt;[ValueType](#valuetype)&gt; | Yes| Array of **ValueType**s to match.| | value | Array&lt;[ValueType](#valuetype)&gt; | Yes| Array of **ValueType**s to match.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.| | [DataAbilityPredicates](#dataabilitypredicates) | **DataAbilityPredicates** object that matches the specified field.|
**Example** **Example**
```js ```js
dataAbilityPredicates.notIn("NAME", ["Lisa", "Rose"]) dataAbilityPredicates.notIn("NAME", ["Lisa", "Rose"])
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册