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

!6189 dataSharePredicates 命名空间同步修改

Merge pull request !6189 from ltdong/master
...@@ -1204,7 +1204,7 @@ promise.then(async (ret) => { ...@@ -1204,7 +1204,7 @@ promise.then(async (ret) => {
``` ```
### update<sup>9+</sup> ### update<sup>9+</sup>
update(table: string, values: ValuesBucket, predicates: DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void
Updates data in the database based on the specified **DataSharePredicates** object. This API uses an asynchronous callback to return the result. Updates data in the database based on the specified **DataSharePredicates** object. This API uses an asynchronous callback to return the result.
...@@ -1215,19 +1215,19 @@ Updates data in the database based on the specified **DataSharePredicates** obje ...@@ -1215,19 +1215,19 @@ Updates data in the database based on the specified **DataSharePredicates** obje
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | Yes| Name of the target table.| | table | string | Yes| Name of the target table.|
| values | [ValuesBucket](#valuesbucket) | Yes| Rows of data to be updated in the database. The key-value pair is associated with the column name in the target table.| | values | [ValuesBucket](#valuesbucket) | Yes| Rows of data to be updated in the database. The key-value pair is associated with the column name in the target table.|
| predicates | DataSharePredicates | Yes| Update conditions specified by the **DataSharePredicates** object.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Update conditions specified by the **DataSharePredicates** object.|
| callback | AsyncCallback&lt;number&gt; | Yes| Callback used to return the number of rows updated.| | callback | AsyncCallback&lt;number&gt; | Yes| Callback used to return the number of rows updated.|
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
const valueBucket = { const valueBucket = {
"NAME": "Rose", "NAME": "Rose",
"AGE": 22, "AGE": 22,
"SALARY": 200.5, "SALARY": 200.5,
"CODES": new Uint8Array([1, 2, 3, 4, 5]), "CODES": new Uint8Array([1, 2, 3, 4, 5]),
} }
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) { rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) {
if (err) { if (err) {
...@@ -1239,7 +1239,7 @@ rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) { ...@@ -1239,7 +1239,7 @@ rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) {
``` ```
### update<sup>9+</sup> ### update<sup>9+</sup>
update(table: string, values: ValuesBucket, predicates: DataSharePredicates):Promise&lt;number&gt; update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates):Promise&lt;number&gt;
Updates data in the database based on the specified **DataSharePredicates** object. This API uses a promise to return the result. Updates data in the database based on the specified **DataSharePredicates** object. This API uses a promise to return the result.
...@@ -1250,7 +1250,7 @@ Updates data in the database based on the specified **DataSharePredicates** obje ...@@ -1250,7 +1250,7 @@ Updates data in the database based on the specified **DataSharePredicates** obje
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | Yes| Name of the target table.| | table | string | Yes| Name of the target table.|
| values | [ValuesBucket](#valuesbucket) | Yes| Rows of data to be updated in the database. The key-value pair is associated with the column name in the target table.| | values | [ValuesBucket](#valuesbucket) | Yes| Rows of data to be updated in the database. The key-value pair is associated with the column name in the target table.|
| predicates | DataSharePredicates | Yes| Update conditions specified by the **DataSharePredicates** object.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Update conditions specified by the **DataSharePredicates** object.|
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -1259,14 +1259,14 @@ Updates data in the database based on the specified **DataSharePredicates** obje ...@@ -1259,14 +1259,14 @@ Updates data in the database based on the specified **DataSharePredicates** obje
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
const valueBucket = { const valueBucket = {
"NAME": "Rose", "NAME": "Rose",
"AGE": 22, "AGE": 22,
"SALARY": 200.5, "SALARY": 200.5,
"CODES": new Uint8Array([1, 2, 3, 4, 5]), "CODES": new Uint8Array([1, 2, 3, 4, 5]),
} }
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
let promise = rdbStore.update("EMPLOYEE", valueBucket, predicates) let promise = rdbStore.update("EMPLOYEE", valueBucket, predicates)
promise.then(async (ret) => { promise.then(async (ret) => {
...@@ -1337,7 +1337,7 @@ promise.then((rows) => { ...@@ -1337,7 +1337,7 @@ promise.then((rows) => {
### delete<sup>9+</sup> ### delete<sup>9+</sup>
delete(table: string, predicates: DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void
Deletes data from the database based on the specified **DataSharePredicates** object. This API uses an asynchronous callback to return the result. Deletes data from the database based on the specified **DataSharePredicates** object. This API uses an asynchronous callback to return the result.
...@@ -1348,13 +1348,13 @@ Deletes data from the database based on the specified **DataSharePredicates** ob ...@@ -1348,13 +1348,13 @@ Deletes data from the database based on the specified **DataSharePredicates** ob
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | Yes| Name of the target table.| | table | string | Yes| Name of the target table.|
| predicates | DataSharePredicates | Yes| Conditions specified by the **DataSharePredicates** object for deleting data.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Conditions specified by the **DataSharePredicates** object for deleting data.|
| callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the number of rows updated.| | callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the number of rows updated.|
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
rdbStore.delete("EMPLOYEE", predicates, function (err, rows) { rdbStore.delete("EMPLOYEE", predicates, function (err, rows) {
if (err) { if (err) {
...@@ -1376,7 +1376,7 @@ Deletes data from the database based on the specified **DataSharePredicates** ob ...@@ -1376,7 +1376,7 @@ Deletes data from the database based on the specified **DataSharePredicates** ob
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | Yes| Name of the target table.| | table | string | Yes| Name of the target table.|
| predicates | DataSharePredicates | Yes| Conditions specified by the **DataSharePredicates** object for deleting data.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Conditions specified by the **DataSharePredicates** object for deleting data.|
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -1385,8 +1385,8 @@ Deletes data from the database based on the specified **DataSharePredicates** ob ...@@ -1385,8 +1385,8 @@ Deletes data from the database based on the specified **DataSharePredicates** ob
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
let promise = rdbStore.delete("EMPLOYEE", predicates) let promise = rdbStore.delete("EMPLOYEE", predicates)
promise.then((rows) => { promise.then((rows) => {
...@@ -1460,7 +1460,7 @@ Queries data in the database based on specified conditions. This API uses a prom ...@@ -1460,7 +1460,7 @@ Queries data in the database based on specified conditions. This API uses a prom
### query<sup>9+</sup> ### query<sup>9+</sup>
query(predicates: DataSharePredicates, columns: Array&lt;string&gt;, callback: AsyncCallback&lt;ResultSet&gt;):void query(predicates: dataSharePredicates.DataSharePredicates, columns: Array&lt;string&gt;, callback: AsyncCallback&lt;ResultSet&gt;):void
Queries data in the database based on specified conditions. This API uses an asynchronous callback to return the result. Queries data in the database based on specified conditions. This API uses an asynchronous callback to return the result.
...@@ -1469,14 +1469,14 @@ Queries data in the database based on specified conditions. This API uses an asy ...@@ -1469,14 +1469,14 @@ Queries data in the database based on specified conditions. This API uses an asy
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| predicates | DataSharePredicates | Yes| Query conditions specified by the **DataSharePredicates** object.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Query conditions specified by the **DataSharePredicates** object.|
| columns | Array&lt;string&gt; | Yes| Columns to query. If this parameter is not specified, the query applies to all columns.| | columns | Array&lt;string&gt; | Yes| Columns to query. If this parameter is not specified, the query applies to all columns.|
| callback | AsyncCallback&lt;[ResultSet](js-apis-data-resultset.md)&gt; | Yes| Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.| | callback | AsyncCallback&lt;[ResultSet](js-apis-data-resultset.md)&gt; | Yes| Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) { rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) { if (err) {
...@@ -1490,7 +1490,7 @@ rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], ...@@ -1490,7 +1490,7 @@ rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"],
### query<sup>9+</sup> ### query<sup>9+</sup>
query(predicates: DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt;ResultSet&gt; query(predicates: dataSharePredicates.DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt;ResultSet&gt;
Queries data in the database based on specified conditions. This API uses a promise to return the result. Queries data in the database based on specified conditions. This API uses a promise to return the result.
...@@ -1499,7 +1499,7 @@ Queries data in the database based on specified conditions. This API uses a prom ...@@ -1499,7 +1499,7 @@ Queries data in the database based on specified conditions. This API uses a prom
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| predicates | DataSharePredicates | Yes| Query conditions specified by the **DataSharePredicates** object.| | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | Yes| Query conditions specified by the **DataSharePredicates** object.|
| columns | Array&lt;string&gt; | No| Columns to query. If this parameter is not specified, the query applies to all columns.| | columns | Array&lt;string&gt; | No| Columns to query. If this parameter is not specified, the query applies to all columns.|
**Return value** **Return value**
...@@ -1509,8 +1509,8 @@ Queries data in the database based on specified conditions. This API uses a prom ...@@ -1509,8 +1509,8 @@ Queries data in the database based on specified conditions. This API uses a prom
**Example** **Example**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
let promise = rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]) let promise = rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
promise.then((resultSet) => { promise.then((resultSet) => {
......
...@@ -1098,7 +1098,7 @@ promise.then(async (ret) => { ...@@ -1098,7 +1098,7 @@ promise.then(async (ret) => {
``` ```
### update<sup>9+</sup> ### update<sup>9+</sup>
update(table: string, values: ValuesBucket, predicates: DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback&lt;number&gt;):void
根据DataSharePredicates的指定实例对象更新数据库中的数据,结果以callback形式返回。 根据DataSharePredicates的指定实例对象更新数据库中的数据,结果以callback形式返回。
...@@ -1109,19 +1109,19 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates, cal ...@@ -1109,19 +1109,19 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates, cal
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | 是 | 指定的目标表名。 | | table | string | 是 | 指定的目标表名。 |
| values | [ValuesBucket](#valuesbucket) | 是 | values指示数据库中要更新的数据行。键值对与数据库表的列名相关联。 | | values | [ValuesBucket](#valuesbucket) | 是 | values指示数据库中要更新的数据行。键值对与数据库表的列名相关联。 |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的更新条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates)| 是 | DataSharePredicates的实例对象指定的更新条件。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定的callback回调方法。返回受影响的行数。 | | callback | AsyncCallback&lt;number&gt; | 是 | 指定的callback回调方法。返回受影响的行数。 |
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
const valueBucket = { const valueBucket = {
"NAME": "Rose", "NAME": "Rose",
"AGE": 22, "AGE": 22,
"SALARY": 200.5, "SALARY": 200.5,
"CODES": new Uint8Array([1, 2, 3, 4, 5]), "CODES": new Uint8Array([1, 2, 3, 4, 5]),
} }
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) { rdbStore.update("EMPLOYEE", valueBucket, predicates, function (err, ret) {
if (err) { if (err) {
...@@ -1144,7 +1144,7 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates):Pro ...@@ -1144,7 +1144,7 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates):Pro
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | 是 | 指定的目标表名。 | | table | string | 是 | 指定的目标表名。 |
| values | [ValuesBucket](#valuesbucket) | 是 | values指示数据库中要更新的数据行。键值对与数据库表的列名相关联。 | | values | [ValuesBucket](#valuesbucket) | 是 | values指示数据库中要更新的数据行。键值对与数据库表的列名相关联。 |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的更新条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 | DataSharePredicates的实例对象指定的更新条件。 |
**返回值** **返回值**
| 类型 | 说明 | | 类型 | 说明 |
...@@ -1153,14 +1153,14 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates):Pro ...@@ -1153,14 +1153,14 @@ update(table: string, values: ValuesBucket, predicates: DataSharePredicates):Pro
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
const valueBucket = { const valueBucket = {
"NAME": "Rose", "NAME": "Rose",
"AGE": 22, "AGE": 22,
"SALARY": 200.5, "SALARY": 200.5,
"CODES": new Uint8Array([1, 2, 3, 4, 5]), "CODES": new Uint8Array([1, 2, 3, 4, 5]),
} }
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
let promise = rdbStore.update("EMPLOYEE", valueBucket, predicates) let promise = rdbStore.update("EMPLOYEE", valueBucket, predicates)
promise.then(async (ret) => { promise.then(async (ret) => {
...@@ -1242,13 +1242,13 @@ delete(table: string, predicates: DataSharePredicates, callback: AsyncCallback&l ...@@ -1242,13 +1242,13 @@ delete(table: string, predicates: DataSharePredicates, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | 是 | 指定的目标表名。 | | table | string | 是 | 指定的目标表名。 |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的删除条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 | DataSharePredicates的实例对象指定的删除条件。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定callback回调函数。返回受影响的行数。 | | callback | AsyncCallback&lt;number&gt; | 是 | 指定callback回调函数。返回受影响的行数。 |
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
rdbStore.delete("EMPLOYEE", predicates, function (err, rows) { rdbStore.delete("EMPLOYEE", predicates, function (err, rows) {
if (err) { if (err) {
...@@ -1260,7 +1260,7 @@ rdbStore.delete("EMPLOYEE", predicates, function (err, rows) { ...@@ -1260,7 +1260,7 @@ rdbStore.delete("EMPLOYEE", predicates, function (err, rows) {
``` ```
### delete<sup>9+</sup> ### delete<sup>9+</sup>
delete(table: string, predicates: DataSharePredicates):Promise&lt;number&gt; delete(table: string, predicates: dataSharePredicates.DataSharePredicates):Promise&lt;number&gt;
根据DataSharePredicates的指定实例对象从数据库中删除数据,结果以Promise形式返回。 根据DataSharePredicates的指定实例对象从数据库中删除数据,结果以Promise形式返回。
...@@ -1270,7 +1270,7 @@ delete(table: string, predicates: DataSharePredicates):Promise&lt;number&gt; ...@@ -1270,7 +1270,7 @@ delete(table: string, predicates: DataSharePredicates):Promise&lt;number&gt;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| table | string | 是 | 指定的目标表名。 | | table | string | 是 | 指定的目标表名。 |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的删除条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 | DataSharePredicates的实例对象指定的删除条件。 |
**返回值** **返回值**
| 类型 | 说明 | | 类型 | 说明 |
...@@ -1279,8 +1279,8 @@ delete(table: string, predicates: DataSharePredicates):Promise&lt;number&gt; ...@@ -1279,8 +1279,8 @@ delete(table: string, predicates: DataSharePredicates):Promise&lt;number&gt;
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Lisa") predicates.equalTo("NAME", "Lisa")
let promise = rdbStore.delete("EMPLOYEE", predicates) let promise = rdbStore.delete("EMPLOYEE", predicates)
promise.then((rows) => { promise.then((rows) => {
...@@ -1363,14 +1363,14 @@ query(predicates: DataSharePredicates, columns: Array&lt;string&gt;, callback: A ...@@ -1363,14 +1363,14 @@ query(predicates: DataSharePredicates, columns: Array&lt;string&gt;, callback: A
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的查询条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 | DataSharePredicates的实例对象指定的查询条件。 |
| columns | Array&lt;string&gt; | 是 | 表示要查询的列。如果值为空,则查询应用于所有列。 | | columns | Array&lt;string&gt; | 是 | 表示要查询的列。如果值为空,则查询应用于所有列。 |
| callback | AsyncCallback&lt;[ResultSet](js-apis-data-resultset.md)&gt; | 是 | 指定callback回调函数。如果操作成功,则返回ResultSet对象。 | | callback | AsyncCallback&lt;[ResultSet](js-apis-data-resultset.md)&gt; | 是 | 指定callback回调函数。如果操作成功,则返回ResultSet对象。 |
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) { rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) { if (err) {
...@@ -1393,7 +1393,7 @@ query(predicates: DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt ...@@ -1393,7 +1393,7 @@ query(predicates: DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| predicates | DataSharePredicates | 是 | DataSharePredicates的实例对象指定的查询条件。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 | DataSharePredicates的实例对象指定的查询条件。 |
| columns | Array&lt;string&gt; | 否 | 表示要查询的列。如果值为空,则查询应用于所有列。 | | columns | Array&lt;string&gt; | 否 | 表示要查询的列。如果值为空,则查询应用于所有列。 |
**返回值** **返回值**
...@@ -1403,8 +1403,8 @@ query(predicates: DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt ...@@ -1403,8 +1403,8 @@ query(predicates: DataSharePredicates, columns?: Array&lt;string&gt;):Promise&lt
**示例:** **示例:**
```js ```js
import dataShare from '@ohos.data.dataShare' import dataSharePredicates from '@ohos.data.dataSharePredicates'
let predicates = new dataShare.DataSharePredicates() let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
let promise = rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]) let promise = rdbStore.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
promise.then((resultSet) => { promise.then((resultSet) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册