提交 d9905afe 编写于 作者: G ge-yafang

update docs

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 f3bfea1a
...@@ -44,7 +44,10 @@ dataShareHelper.query(uri, da, columns).then((data) => { ...@@ -44,7 +44,10 @@ dataShareHelper.query(uri, da, columns).then((data) => {
}); });
``` ```
## 属性 ## DataShareResultSet
提供通过查询数据库生成的结果集的相关访问方法。
### 属性
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core
...@@ -55,7 +58,7 @@ dataShareHelper.query(uri, da, columns).then((data) => { ...@@ -55,7 +58,7 @@ dataShareHelper.query(uri, da, columns).then((data) => {
| rowCount | number | 是 | 结果集中的行数。 | | rowCount | number | 是 | 结果集中的行数。 |
| isClosed | boolean | 是 | 标识当前结果集是否关闭。 | | isClosed | boolean | 是 | 标识当前结果集是否关闭。 |
## goToFirstRow ### goToFirstRow
goToFirstRow(): boolean goToFirstRow(): boolean
...@@ -76,7 +79,7 @@ let isGoTOFirstRow = resultSet.goToFirstRow(); ...@@ -76,7 +79,7 @@ let isGoTOFirstRow = resultSet.goToFirstRow();
console.info('resultSet.goToFirstRow: ' + isGoTOFirstRow); console.info('resultSet.goToFirstRow: ' + isGoTOFirstRow);
``` ```
## goToLastRow ### goToLastRow
goToLastRow(): boolean goToLastRow(): boolean
...@@ -97,7 +100,7 @@ let isGoToLastRow = resultSet.goToLastRow(); ...@@ -97,7 +100,7 @@ let isGoToLastRow = resultSet.goToLastRow();
console.info('resultSet.goToLastRow: ' + isGoToLastRow); console.info('resultSet.goToLastRow: ' + isGoToLastRow);
``` ```
## goToNextRow ### goToNextRow
goToNextRow(): boolean goToNextRow(): boolean
...@@ -118,7 +121,7 @@ let isGoToNextRow = resultSet.goToNextRow(); ...@@ -118,7 +121,7 @@ let isGoToNextRow = resultSet.goToNextRow();
console.info('resultSet.goToNextRow: ' + isGoToNextRow); console.info('resultSet.goToNextRow: ' + isGoToNextRow);
``` ```
## goToPreviousRow ### goToPreviousRow
goToPreviousRow(): boolean goToPreviousRow(): boolean
...@@ -139,7 +142,7 @@ let isGoToPreviousRow = resultSet.goToPreviousRow(); ...@@ -139,7 +142,7 @@ let isGoToPreviousRow = resultSet.goToPreviousRow();
console.info('resultSet.goToPreviousRow: ' + isGoToPreviousRow); console.info('resultSet.goToPreviousRow: ' + isGoToPreviousRow);
``` ```
## goTo ### goTo
goTo(offset:number): boolean goTo(offset:number): boolean
...@@ -167,7 +170,7 @@ let isGoTo = resultSet.goTo(goToNum); ...@@ -167,7 +170,7 @@ let isGoTo = resultSet.goTo(goToNum);
console.info('resultSet.goTo: ' + isGoTo); console.info('resultSet.goTo: ' + isGoTo);
``` ```
## goToRow ### goToRow
goToRow(position: number): boolean goToRow(position: number): boolean
...@@ -195,7 +198,7 @@ let isGoToRow = resultSet.goToRow(goToRowNum); ...@@ -195,7 +198,7 @@ let isGoToRow = resultSet.goToRow(goToRowNum);
console.info('resultSet.goToRow: ' + isGoToRow); console.info('resultSet.goToRow: ' + isGoToRow);
``` ```
## getBlob ### getBlob
getBlob(columnIndex: number): Uint8Array getBlob(columnIndex: number): Uint8Array
...@@ -224,7 +227,7 @@ let getBlob = resultSet.getBlob(columnIndex); ...@@ -224,7 +227,7 @@ let getBlob = resultSet.getBlob(columnIndex);
console.info('resultSet.getBlob: ' + getBlob); console.info('resultSet.getBlob: ' + getBlob);
``` ```
## getString ### getString
getString(columnIndex: number): *string* getString(columnIndex: number): *string*
...@@ -253,7 +256,7 @@ let getString = resultSet.getString(columnIndex); ...@@ -253,7 +256,7 @@ let getString = resultSet.getString(columnIndex);
console.info('resultSet.getString: ' + getString); console.info('resultSet.getString: ' + getString);
``` ```
## getLong ### getLong
getLong(columnIndex: number): number getLong(columnIndex: number): number
...@@ -282,7 +285,7 @@ let getLong = resultSet.getLong(columnIndex); ...@@ -282,7 +285,7 @@ let getLong = resultSet.getLong(columnIndex);
console.info('resultSet.getLong: ' + getLong); console.info('resultSet.getLong: ' + getLong);
``` ```
## getDouble ### getDouble
getDouble(columnIndex: number): number getDouble(columnIndex: number): number
...@@ -311,7 +314,7 @@ let getDouble = resultSet.getDouble(columnIndex); ...@@ -311,7 +314,7 @@ let getDouble = resultSet.getDouble(columnIndex);
console.info('resultSet.getDouble: ' + getDouble); console.info('resultSet.getDouble: ' + getDouble);
``` ```
## close ### close
close(): void close(): void
...@@ -325,7 +328,7 @@ close(): void ...@@ -325,7 +328,7 @@ close(): void
resultSet.close(); resultSet.close();
``` ```
## getColumnIndex ### getColumnIndex
getColumnIndex(columnName: string): number getColumnIndex(columnName: string): number
...@@ -353,7 +356,7 @@ let getColumnIndex = resultSet.getColumnIndex(ColumnName) ...@@ -353,7 +356,7 @@ let getColumnIndex = resultSet.getColumnIndex(ColumnName)
console.info('resultSet.getColumnIndex: ' + getColumnIndex); console.info('resultSet.getColumnIndex: ' + getColumnIndex);
``` ```
## getColumnName ### getColumnName
getColumnName(columnIndex: number): *string* getColumnName(columnIndex: number): *string*
...@@ -381,7 +384,7 @@ let getColumnName = resultSet.getColumnName(columnIndex) ...@@ -381,7 +384,7 @@ let getColumnName = resultSet.getColumnName(columnIndex)
console.info('resultSet.getColumnName: ' + getColumnName); console.info('resultSet.getColumnName: ' + getColumnName);
``` ```
## getDataType ### getDataType
getDataType(columnIndex: number): DataType getDataType(columnIndex: number): DataType
...@@ -409,7 +412,7 @@ let getDataType = resultSet.getDataType(columnIndex); ...@@ -409,7 +412,7 @@ let getDataType = resultSet.getDataType(columnIndex);
console.info('resultSet.getDataType: ' + getDataType); console.info('resultSet.getDataType: ' + getDataType);
``` ```
## DataType ### DataType
数据类型枚举。 数据类型枚举。
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
import dataSharePredicates from '@ohos.data.dataSharePredicates'; import dataSharePredicates from '@ohos.data.dataSharePredicates';
``` ```
## equalTo ## DataSharePredicates
提供用于不同实现不同查询方法的数据共享谓词。
### equalTo
equalTo(field: string, value: ValueType): DataSharePredicates equalTo(field: string, value: ValueType): DataSharePredicates
...@@ -43,7 +46,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -43,7 +46,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose") predicates.equalTo("NAME", "Rose")
``` ```
## notEqualTo ### notEqualTo
notEqualTo(field: string, value: ValueType): DataSharePredicates notEqualTo(field: string, value: ValueType): DataSharePredicates
...@@ -73,7 +76,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -73,7 +76,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notEqualTo("NAME", "Rose") predicates.notEqualTo("NAME", "Rose")
``` ```
## beginWrap ### beginWrap
beginWrap(): DataSharePredicates beginWrap(): DataSharePredicates
...@@ -99,7 +102,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -99,7 +102,7 @@ predicates.equalTo("NAME", "lisi")
.endWrap() .endWrap()
``` ```
## endWrap ### endWrap
endWrap(): DataSharePredicates endWrap(): DataSharePredicates
...@@ -125,7 +128,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -125,7 +128,7 @@ predicates.equalTo("NAME", "lisi")
.endWrap() .endWrap()
``` ```
## or ### or
or(): DataSharePredicates or(): DataSharePredicates
...@@ -150,7 +153,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -150,7 +153,7 @@ predicates.equalTo("NAME", "lisi")
.equalTo("NAME", "Rose") .equalTo("NAME", "Rose")
``` ```
## and ### and
and(): DataSharePredicates and(): DataSharePredicates
...@@ -175,7 +178,7 @@ predicates.equalTo("NAME", "lisi") ...@@ -175,7 +178,7 @@ predicates.equalTo("NAME", "lisi")
.equalTo("SALARY", 200.5) .equalTo("SALARY", 200.5)
``` ```
## contains ### contains
contains(field: string, value: string): DataSharePredicates contains(field: string, value: string): DataSharePredicates
...@@ -203,7 +206,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -203,7 +206,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.contains("NAME", "os") predicates.contains("NAME", "os")
``` ```
## beginsWith ### beginsWith
beginsWith(field: string, value: string): DataSharePredicates beginsWith(field: string, value: string): DataSharePredicates
...@@ -231,7 +234,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -231,7 +234,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.beginsWith("NAME", "os") predicates.beginsWith("NAME", "os")
``` ```
## endsWith ### endsWith
endsWith(field: string, value: string): DataSharePredicates endsWith(field: string, value: string): DataSharePredicates
...@@ -259,7 +262,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -259,7 +262,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.endsWith("NAME", "os") predicates.endsWith("NAME", "os")
``` ```
## isNull ### isNull
isNull(field: string): DataSharePredicates isNull(field: string): DataSharePredicates
...@@ -288,7 +291,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -288,7 +291,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.isNull("NAME") predicates.isNull("NAME")
``` ```
## isNotNull ### isNotNull
isNotNull(field: string): DataSharePredicates isNotNull(field: string): DataSharePredicates
...@@ -317,7 +320,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -317,7 +320,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.isNotNull("NAME") predicates.isNotNull("NAME")
``` ```
## like ### like
like(field: string, value: string): DataSharePredicates like(field: string, value: string): DataSharePredicates
...@@ -347,7 +350,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -347,7 +350,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.like("NAME", "%os%") predicates.like("NAME", "%os%")
``` ```
## unlike ### unlike
unlike(field: string, value: string): DataSharePredicates unlike(field: string, value: string): DataSharePredicates
...@@ -377,7 +380,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -377,7 +380,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.unlike("NAME", "%os%") predicates.unlike("NAME", "%os%")
``` ```
## glob ### glob
glob(field: string, value: string): DataSharePredicates glob(field: string, value: string): DataSharePredicates
...@@ -405,7 +408,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -405,7 +408,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.glob("NAME", "?h*g") predicates.glob("NAME", "?h*g")
``` ```
## between ### between
between(field: string, low: ValueType, high: ValueType): DataSharePredicates between(field: string, low: ValueType, high: ValueType): DataSharePredicates
...@@ -434,7 +437,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -434,7 +437,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.between("AGE", 10, 50) predicates.between("AGE", 10, 50)
``` ```
## notBetween ### notBetween
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates
...@@ -463,7 +466,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -463,7 +466,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notBetween("AGE", 10, 50) predicates.notBetween("AGE", 10, 50)
``` ```
## greaterThan ### greaterThan
greaterThan(field: string, value: ValueType): DataSharePredicates greaterThan(field: string, value: ValueType): DataSharePredicates
...@@ -493,7 +496,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -493,7 +496,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.greaterThan("AGE", 10) predicates.greaterThan("AGE", 10)
``` ```
## lessThan ### lessThan
lessThan(field: string, value: ValueType): DataSharePredicates lessThan(field: string, value: ValueType): DataSharePredicates
...@@ -523,7 +526,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -523,7 +526,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.lessThan("AGE", 50) predicates.lessThan("AGE", 50)
``` ```
## greaterThanOrEqualTo ### greaterThanOrEqualTo
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
...@@ -553,7 +556,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -553,7 +556,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.greaterThanOrEqualTo("AGE", 10) predicates.greaterThanOrEqualTo("AGE", 10)
``` ```
## lessThanOrEqualTo ### lessThanOrEqualTo
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
...@@ -583,7 +586,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -583,7 +586,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.lessThanOrEqualTo("AGE", 50) predicates.lessThanOrEqualTo("AGE", 50)
``` ```
## orderByAsc ### orderByAsc
orderByAsc(field: string): DataSharePredicates orderByAsc(field: string): DataSharePredicates
...@@ -612,7 +615,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -612,7 +615,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.orderByAsc("AGE") predicates.orderByAsc("AGE")
``` ```
## orderByDesc ### orderByDesc
orderByDesc(field: string): DataSharePredicates orderByDesc(field: string): DataSharePredicates
...@@ -641,7 +644,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -641,7 +644,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.orderByDesc("AGE") predicates.orderByDesc("AGE")
``` ```
## distinct ### distinct
distinct(): DataSharePredicates distinct(): DataSharePredicates
...@@ -662,7 +665,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -662,7 +665,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose").distinct() predicates.equalTo("NAME", "Rose").distinct()
``` ```
## limit ### limit
limit(total: number, offset: number): DataSharePredicates limit(total: number, offset: number): DataSharePredicates
...@@ -692,7 +695,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -692,7 +695,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.equalTo("NAME", "Rose").limit(10, 3) predicates.equalTo("NAME", "Rose").limit(10, 3)
``` ```
## groupBy ### groupBy
groupBy(fields: Array&lt;string&gt;): DataSharePredicates groupBy(fields: Array&lt;string&gt;): DataSharePredicates
...@@ -719,7 +722,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -719,7 +722,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.groupBy(["AGE", "NAME"]) predicates.groupBy(["AGE", "NAME"])
``` ```
## indexedBy ### indexedBy
indexedBy(field: string): DataSharePredicates indexedBy(field: string): DataSharePredicates
...@@ -746,7 +749,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -746,7 +749,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.indexedBy("SALARY_INDEX") predicates.indexedBy("SALARY_INDEX")
``` ```
## in ### in
in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates in(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
...@@ -776,7 +779,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -776,7 +779,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.in("AGE", [18, 20]) predicates.in("AGE", [18, 20])
``` ```
## notIn ### notIn
notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates notIn(field: string, value: Array&lt;ValueType&gt;): DataSharePredicates
...@@ -806,7 +809,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -806,7 +809,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.notIn("NAME", ["Lisa", "Rose"]) predicates.notIn("NAME", ["Lisa", "Rose"])
``` ```
## prefixKey ### prefixKey
prefixKey(prefix: string): DataSharePredicates prefixKey(prefix: string): DataSharePredicates
...@@ -833,7 +836,7 @@ let predicates = new dataSharePredicates.DataSharePredicates() ...@@ -833,7 +836,7 @@ let predicates = new dataSharePredicates.DataSharePredicates()
predicates.prefixKey("NAME") predicates.prefixKey("NAME")
``` ```
## inKeys ### inKeys
inKeys(keys: Array&lt;string&gt;): DataSharePredicates inKeys(keys: Array&lt;string&gt;): DataSharePredicates
......
...@@ -3718,7 +3718,7 @@ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: Asyn ...@@ -3718,7 +3718,7 @@ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: Asyn
| 参数名 | 参数类型 | 必填 | 说明 | | 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- | | ----- | ------ | ---- | ----------------------- |
| predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 |指示筛选条件,当此参数为null时,应定义处理逻辑。 | | predicates | [DataSharePredicates](js-apis-data-DataSharePredicates.md#datasharepredicates) | 是 |指示筛选条件,当此参数为null时,应定义处理逻辑。 |
| callback |AsyncCallback&lt;[KvStoreResultSet](#kvstoreresultsetsup8sup)&gt; | 是 |回调函数,获取与指定Predicates对象匹配的KvStoreResultSet对象。 | | callback |AsyncCallback&lt;[KvStoreResultSet](#kvstoreresultset8)&gt; | 是 |回调函数,获取与指定Predicates对象匹配的KvStoreResultSet对象。 |
**示例:** **示例:**
...@@ -4202,7 +4202,7 @@ sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void ...@@ -4202,7 +4202,7 @@ sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void
| ----- | ------ | ---- | ----------------------- | | ----- | ------ | ---- | ----------------------- |
| deviceIds |string[] | 是 |同一组网环境下,需要同步的设备的deviceId列表。 | | deviceIds |string[] | 是 |同一组网环境下,需要同步的设备的deviceId列表。 |
| mode |[SyncMode](#syncmode) | 是 |同步模式。 | | mode |[SyncMode](#syncmode) | 是 |同步模式。 |
| query |[Query](#querysup8sup) | 是 |表示数据库的查询谓词条件 | | query |[Query](#query8) | 是 |表示数据库的查询谓词条件 |
| delayMs |number | 否 |可选参数,允许延时时间,单位:ms(毫秒)。 | | delayMs |number | 否 |可选参数,允许延时时间,单位:ms(毫秒)。 |
**示例:** **示例:**
......
...@@ -531,7 +531,7 @@ screen.setScreenRotationLocked(isLocked, (err, data) => { ...@@ -531,7 +531,7 @@ screen.setScreenRotationLocked(isLocked, (err, data) => {
| parent | number | 是 | 否 | 屏幕所属群组的id。 | | parent | number | 是 | 否 | 屏幕所属群组的id。 |
| supportedModeInfo | Array&lt;[ScreenModeInfo](#screenmodeinfo)&gt; | 是 | 否 | 屏幕支持的模式集合。 | | supportedModeInfo | Array&lt;[ScreenModeInfo](#screenmodeinfo)&gt; | 是 | 否 | 屏幕支持的模式集合。 |
| activeModeIndex | number | 是 | 否 | 当前屏幕所处模式索引。 | | activeModeIndex | number | 是 | 否 | 当前屏幕所处模式索引。 |
| orientation | [Orientation](#rientation) | 是 | 否 | 屏幕方向。 | | orientation | [Orientation](#orientation) | 是 | 否 | 屏幕方向。 |
### setOrientation ### setOrientation
setOrientation(orientation: Orientation, callback: AsyncCallback&lt;void&gt;): void setOrientation(orientation: Orientation, callback: AsyncCallback&lt;void&gt;): void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册