17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci
167777dab0Sopenharmony_ci#ifndef OH_PREDICATES_H
177777dab0Sopenharmony_ci#define OH_PREDICATES_H
187777dab0Sopenharmony_ci
197777dab0Sopenharmony_ci/**
207777dab0Sopenharmony_ci * @addtogroup RDB
217777dab0Sopenharmony_ci * @{
227777dab0Sopenharmony_ci *
237777dab0Sopenharmony_ci * @brief The relational database (RDB) store manages data based on relational models.
247777dab0Sopenharmony_ci * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases.
257777dab0Sopenharmony_ci * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations
267777dab0Sopenharmony_ci * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements.
277777dab0Sopenharmony_ci *
287777dab0Sopenharmony_ci * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
297777dab0Sopenharmony_ci * @since 10
307777dab0Sopenharmony_ci */
317777dab0Sopenharmony_ci
327777dab0Sopenharmony_ci/**
337777dab0Sopenharmony_ci * @file oh_predicates.h
347777dab0Sopenharmony_ci *
357777dab0Sopenharmony_ci * @brief Declared predicate related functions and enumerations.
367777dab0Sopenharmony_ci *
377777dab0Sopenharmony_ci * @kit ArkData
387777dab0Sopenharmony_ci * @since 10
397777dab0Sopenharmony_ci */
407777dab0Sopenharmony_ci
417777dab0Sopenharmony_ci#include <cstdint>
427777dab0Sopenharmony_ci#include <stddef.h>
437777dab0Sopenharmony_ci#include "database/rdb/oh_value_object.h"
447777dab0Sopenharmony_ci
457777dab0Sopenharmony_ci#ifdef __cplusplus
467777dab0Sopenharmony_ciextern "C" {
477777dab0Sopenharmony_ci#endif
487777dab0Sopenharmony_ci
497777dab0Sopenharmony_ci/**
507777dab0Sopenharmony_ci * @brief Result set sort type.
517777dab0Sopenharmony_ci *
527777dab0Sopenharmony_ci * @since 10
537777dab0Sopenharmony_ci */
547777dab0Sopenharmony_citypedef enum OH_OrderType {
557777dab0Sopenharmony_ci    /**
567777dab0Sopenharmony_ci     * Ascend order.
577777dab0Sopenharmony_ci     */
587777dab0Sopenharmony_ci    ASC = 0,
597777dab0Sopenharmony_ci    /**
607777dab0Sopenharmony_ci     * Descend order.
617777dab0Sopenharmony_ci     */
627777dab0Sopenharmony_ci    DESC = 1,
637777dab0Sopenharmony_ci} OH_OrderType;
647777dab0Sopenharmony_ci
657777dab0Sopenharmony_ci/**
667777dab0Sopenharmony_ci * @brief Define the OH_Predicates structure type.
677777dab0Sopenharmony_ci *
687777dab0Sopenharmony_ci * @since 10
697777dab0Sopenharmony_ci */
707777dab0Sopenharmony_citypedef struct OH_Predicates {
717777dab0Sopenharmony_ci    /**
727777dab0Sopenharmony_ci     * The id used to uniquely identify the OH_Predicates struct.
737777dab0Sopenharmony_ci     */
747777dab0Sopenharmony_ci    int64_t id;
757777dab0Sopenharmony_ci
767777dab0Sopenharmony_ci    /**
777777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the value of the field to be equal to the specified value to the predicates.
787777dab0Sopenharmony_ci     *
797777dab0Sopenharmony_ci     * This method is similar to = of the SQL statement.
807777dab0Sopenharmony_ci     *
817777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
827777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
837777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
847777dab0Sopenharmony_ci     * @return Returns the self.
857777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
867777dab0Sopenharmony_ci     * @since 10
877777dab0Sopenharmony_ci     */
887777dab0Sopenharmony_ci    OH_Predicates *(*equalTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
897777dab0Sopenharmony_ci
907777dab0Sopenharmony_ci    /**
917777dab0Sopenharmony_ci     * @brief Function pointer.
927777dab0Sopenharmony_ci     * Restricts the value of the field to be not equal to the specified value to the predicates.
937777dab0Sopenharmony_ci     *
947777dab0Sopenharmony_ci     * This method is similar to != of the SQL statement.
957777dab0Sopenharmony_ci     *
967777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
977777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
987777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
997777dab0Sopenharmony_ci     * @return Returns the self.
1007777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
1017777dab0Sopenharmony_ci     * @since 10
1027777dab0Sopenharmony_ci     */
1037777dab0Sopenharmony_ci    OH_Predicates *(*notEqualTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
1047777dab0Sopenharmony_ci
1057777dab0Sopenharmony_ci    /**
1067777dab0Sopenharmony_ci     * @brief Function pointer. Add left parenthesis to predicate.
1077777dab0Sopenharmony_ci     *
1087777dab0Sopenharmony_ci     * This method is similar to ( of the SQL statement.
1097777dab0Sopenharmony_ci     *
1107777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1117777dab0Sopenharmony_ci     * @return Returns the self.
1127777dab0Sopenharmony_ci     * @see OH_Predicates.
1137777dab0Sopenharmony_ci     * @since 10
1147777dab0Sopenharmony_ci     */
1157777dab0Sopenharmony_ci    OH_Predicates *(*beginWrap)(OH_Predicates *predicates);
1167777dab0Sopenharmony_ci
1177777dab0Sopenharmony_ci    /**
1187777dab0Sopenharmony_ci     * @brief Function pointer. Add right parenthesis to predicate.
1197777dab0Sopenharmony_ci     *
1207777dab0Sopenharmony_ci     * This method is similar to ) of the SQL statement.
1217777dab0Sopenharmony_ci     *
1227777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1237777dab0Sopenharmony_ci     * @return Returns the self.
1247777dab0Sopenharmony_ci     * @see OH_Predicates.
1257777dab0Sopenharmony_ci     * @since 10
1267777dab0Sopenharmony_ci     */
1277777dab0Sopenharmony_ci    OH_Predicates *(*endWrap)(OH_Predicates *predicates);
1287777dab0Sopenharmony_ci
1297777dab0Sopenharmony_ci    /**
1307777dab0Sopenharmony_ci     * @brief Function pointer. Adds an or condition to the predicates.
1317777dab0Sopenharmony_ci     *
1327777dab0Sopenharmony_ci     * This method is similar to OR of the SQL statement.
1337777dab0Sopenharmony_ci     *
1347777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1357777dab0Sopenharmony_ci     * @return Returns the self.
1367777dab0Sopenharmony_ci     * @see OH_Predicates.
1377777dab0Sopenharmony_ci     * @since 10
1387777dab0Sopenharmony_ci     */
1397777dab0Sopenharmony_ci    OH_Predicates *(*orOperate)(OH_Predicates *predicates);
1407777dab0Sopenharmony_ci
1417777dab0Sopenharmony_ci    /**
1427777dab0Sopenharmony_ci     * @brief Function pointer. Adds an and condition to the predicates.
1437777dab0Sopenharmony_ci     *
1447777dab0Sopenharmony_ci     * This method is similar to AND of the SQL statement.
1457777dab0Sopenharmony_ci     *
1467777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1477777dab0Sopenharmony_ci     * @return Returns the self.
1487777dab0Sopenharmony_ci     * @see OH_Predicates.
1497777dab0Sopenharmony_ci     * @since 10
1507777dab0Sopenharmony_ci     */
1517777dab0Sopenharmony_ci    OH_Predicates *(*andOperate)(OH_Predicates *predicates);
1527777dab0Sopenharmony_ci
1537777dab0Sopenharmony_ci    /**
1547777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the value of the field which is null to the predicates.
1557777dab0Sopenharmony_ci     *
1567777dab0Sopenharmony_ci     * This method is similar to IS NULL of the SQL statement.
1577777dab0Sopenharmony_ci     *
1587777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1597777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
1607777dab0Sopenharmony_ci     * @return Returns the self.
1617777dab0Sopenharmony_ci     * @see OH_Predicates.
1627777dab0Sopenharmony_ci     * @since 10
1637777dab0Sopenharmony_ci     */
1647777dab0Sopenharmony_ci    OH_Predicates *(*isNull)(OH_Predicates *predicates, const char *field);
1657777dab0Sopenharmony_ci
1667777dab0Sopenharmony_ci    /**
1677777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the value of the field which is not null to the predicates.
1687777dab0Sopenharmony_ci     *
1697777dab0Sopenharmony_ci     * This method is similar to IS NOT NULL of the SQL statement.
1707777dab0Sopenharmony_ci     *
1717777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1727777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
1737777dab0Sopenharmony_ci     * @return Returns the self.
1747777dab0Sopenharmony_ci     * @see OH_Predicates.
1757777dab0Sopenharmony_ci     * @since 10
1767777dab0Sopenharmony_ci     */
1777777dab0Sopenharmony_ci    OH_Predicates *(*isNotNull)(OH_Predicates *predicates, const char *field);
1787777dab0Sopenharmony_ci
1797777dab0Sopenharmony_ci    /**
1807777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the value of the field to be like the specified value to the predicates.
1817777dab0Sopenharmony_ci     *
1827777dab0Sopenharmony_ci     * This method is similar to LIKE of the SQL statement.
1837777dab0Sopenharmony_ci     *
1847777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1857777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
1867777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
1877777dab0Sopenharmony_ci     * @return Returns the self.
1887777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
1897777dab0Sopenharmony_ci     * @since 10
1907777dab0Sopenharmony_ci     */
1917777dab0Sopenharmony_ci    OH_Predicates *(*like)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
1927777dab0Sopenharmony_ci
1937777dab0Sopenharmony_ci    /**
1947777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the value of the field to be between the specified value to the predicates.
1957777dab0Sopenharmony_ci     *
1967777dab0Sopenharmony_ci     * This method is similar to BETWEEN of the SQL statement.
1977777dab0Sopenharmony_ci     *
1987777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
1997777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2007777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2017777dab0Sopenharmony_ci     * @return Returns the self.
2027777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2037777dab0Sopenharmony_ci     * @since 10
2047777dab0Sopenharmony_ci     */
2057777dab0Sopenharmony_ci    OH_Predicates *(*between)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2067777dab0Sopenharmony_ci
2077777dab0Sopenharmony_ci    /**
2087777dab0Sopenharmony_ci     * @brief Function pointer.
2097777dab0Sopenharmony_ci     * Restricts the value of the field to be not between the specified value to the predicates.
2107777dab0Sopenharmony_ci     *
2117777dab0Sopenharmony_ci     * This method is similar to NOT BETWEEN of the SQL statement.
2127777dab0Sopenharmony_ci     *
2137777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2147777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2157777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2167777dab0Sopenharmony_ci     * @return Returns the self.
2177777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2187777dab0Sopenharmony_ci     * @since 10
2197777dab0Sopenharmony_ci     */
2207777dab0Sopenharmony_ci    OH_Predicates *(*notBetween)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2217777dab0Sopenharmony_ci
2227777dab0Sopenharmony_ci    /**
2237777dab0Sopenharmony_ci     * @brief Function pointer.
2247777dab0Sopenharmony_ci     * Restricts the value of the field to be greater than the specified value to the predicates.
2257777dab0Sopenharmony_ci     *
2267777dab0Sopenharmony_ci     * This method is similar to > of the SQL statement.
2277777dab0Sopenharmony_ci     *
2287777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2297777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2307777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2317777dab0Sopenharmony_ci     * @return Returns the self.
2327777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2337777dab0Sopenharmony_ci     * @since 10
2347777dab0Sopenharmony_ci     */
2357777dab0Sopenharmony_ci    OH_Predicates *(*greaterThan)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2367777dab0Sopenharmony_ci
2377777dab0Sopenharmony_ci    /**
2387777dab0Sopenharmony_ci     * @brief Function pointer.
2397777dab0Sopenharmony_ci     * Restricts the value of the field to be less than the specified value to the predicates.
2407777dab0Sopenharmony_ci     *
2417777dab0Sopenharmony_ci     * This method is similar to < of the SQL statement.
2427777dab0Sopenharmony_ci     *
2437777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2447777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2457777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2467777dab0Sopenharmony_ci     * @return Returns the self.
2477777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2487777dab0Sopenharmony_ci     * @since 10
2497777dab0Sopenharmony_ci     */
2507777dab0Sopenharmony_ci    OH_Predicates *(*lessThan)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2517777dab0Sopenharmony_ci
2527777dab0Sopenharmony_ci    /**
2537777dab0Sopenharmony_ci     * @brief Function pointer.
2547777dab0Sopenharmony_ci     * Restricts the value of the field to be greater than or equal to the specified value to the predicates.
2557777dab0Sopenharmony_ci     *
2567777dab0Sopenharmony_ci     * This method is similar to >= of the SQL statement.
2577777dab0Sopenharmony_ci     *
2587777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2597777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2607777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2617777dab0Sopenharmony_ci     * @return Returns the self.
2627777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2637777dab0Sopenharmony_ci     * @since 10
2647777dab0Sopenharmony_ci     */
2657777dab0Sopenharmony_ci    OH_Predicates *(*greaterThanOrEqualTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2667777dab0Sopenharmony_ci
2677777dab0Sopenharmony_ci    /**
2687777dab0Sopenharmony_ci     * @brief Function pointer.
2697777dab0Sopenharmony_ci     * Restricts the value of the field to be less than or equal to the specified value to the predicates.
2707777dab0Sopenharmony_ci     *
2717777dab0Sopenharmony_ci     * This method is similar to <= of the SQL statement.
2727777dab0Sopenharmony_ci     *
2737777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2747777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2757777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
2767777dab0Sopenharmony_ci     * @return Returns the self.
2777777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
2787777dab0Sopenharmony_ci     * @since 10
2797777dab0Sopenharmony_ci     */
2807777dab0Sopenharmony_ci    OH_Predicates *(*lessThanOrEqualTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
2817777dab0Sopenharmony_ci
2827777dab0Sopenharmony_ci    /**
2837777dab0Sopenharmony_ci     * @brief Function pointer. Restricts the ascending or descending order of the return list.
2847777dab0Sopenharmony_ci     * When there are several orders, the one close to the head has the highest priority.
2857777dab0Sopenharmony_ci     *
2867777dab0Sopenharmony_ci     * This method is similar ORDER BY the SQL statement.
2877777dab0Sopenharmony_ci     *
2887777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
2897777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
2907777dab0Sopenharmony_ci     * @param type Indicates the sort {@link OH_OrderType} type.
2917777dab0Sopenharmony_ci     * @return Returns the self.
2927777dab0Sopenharmony_ci     * @see OH_Predicates, OH_OrderType.
2937777dab0Sopenharmony_ci     * @since 10
2947777dab0Sopenharmony_ci     */
2957777dab0Sopenharmony_ci    OH_Predicates *(*orderBy)(OH_Predicates *predicates, const char *field, OH_OrderType type);
2967777dab0Sopenharmony_ci
2977777dab0Sopenharmony_ci    /**
2987777dab0Sopenharmony_ci     * @brief Function pointer. Configure predicates to filter duplicate records and retain only one of them.
2997777dab0Sopenharmony_ci     *
3007777dab0Sopenharmony_ci     * This method is similar DISTINCT the SQL statement.
3017777dab0Sopenharmony_ci     *
3027777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3037777dab0Sopenharmony_ci     * @return Returns the self.
3047777dab0Sopenharmony_ci     * @see OH_Predicates.
3057777dab0Sopenharmony_ci     * @since 10
3067777dab0Sopenharmony_ci     */
3077777dab0Sopenharmony_ci    OH_Predicates *(*distinct)(OH_Predicates *predicates);
3087777dab0Sopenharmony_ci
3097777dab0Sopenharmony_ci    /**
3107777dab0Sopenharmony_ci     * @brief Function pointer. Predicate for setting the maximum number of data records.
3117777dab0Sopenharmony_ci     *
3127777dab0Sopenharmony_ci     * This method is similar LIMIT the SQL statement.
3137777dab0Sopenharmony_ci     *
3147777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3157777dab0Sopenharmony_ci     * @param value Indicates the maximum number of records.
3167777dab0Sopenharmony_ci     * @return Returns the self.
3177777dab0Sopenharmony_ci     * @see OH_Predicates.
3187777dab0Sopenharmony_ci     * @since 10
3197777dab0Sopenharmony_ci     */
3207777dab0Sopenharmony_ci    OH_Predicates *(*limit)(OH_Predicates *predicates, unsigned int value);
3217777dab0Sopenharmony_ci
3227777dab0Sopenharmony_ci    /**
3237777dab0Sopenharmony_ci     * @brief Function pointer. Configure the predicate to specify the starting position of the returned result.
3247777dab0Sopenharmony_ci     *
3257777dab0Sopenharmony_ci     * This method is similar OFFSET the SQL statement.
3267777dab0Sopenharmony_ci     *
3277777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3287777dab0Sopenharmony_ci     * @param rowOffset Indicates the number of rows to offset from the beginning. The value is a positive integer.
3297777dab0Sopenharmony_ci     * @return Returns the self.
3307777dab0Sopenharmony_ci     * @see OH_Predicates.
3317777dab0Sopenharmony_ci     * @since 10
3327777dab0Sopenharmony_ci     */
3337777dab0Sopenharmony_ci    OH_Predicates *(*offset)(OH_Predicates *predicates, unsigned int rowOffset);
3347777dab0Sopenharmony_ci
3357777dab0Sopenharmony_ci    /**
3367777dab0Sopenharmony_ci     * @brief Function pointer. Configure predicates to group query results by specified columns.
3377777dab0Sopenharmony_ci     *
3387777dab0Sopenharmony_ci     * This method is similar GROUP BY the SQL statement.
3397777dab0Sopenharmony_ci     *
3407777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3417777dab0Sopenharmony_ci     * @param fields Indicates the column names that the grouping depends on.
3427777dab0Sopenharmony_ci     * @param length Indicates the length of fields.
3437777dab0Sopenharmony_ci     * @return Returns the self.
3447777dab0Sopenharmony_ci     * @see OH_Predicates.
3457777dab0Sopenharmony_ci     * @since 10
3467777dab0Sopenharmony_ci     */
3477777dab0Sopenharmony_ci    OH_Predicates *(*groupBy)(OH_Predicates *predicates, char const *const *fields, int length);
3487777dab0Sopenharmony_ci
3497777dab0Sopenharmony_ci    /**
3507777dab0Sopenharmony_ci     * @brief Function pointer.
3517777dab0Sopenharmony_ci     * Configure the predicate to match the specified field and the value within the given array range.
3527777dab0Sopenharmony_ci     *
3537777dab0Sopenharmony_ci     * This method is similar IN the SQL statement.
3547777dab0Sopenharmony_ci     *
3557777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3567777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
3577777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
3587777dab0Sopenharmony_ci     * @return Returns the self.
3597777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
3607777dab0Sopenharmony_ci     * @since 10
3617777dab0Sopenharmony_ci     */
3627777dab0Sopenharmony_ci    OH_Predicates *(*in)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
3637777dab0Sopenharmony_ci
3647777dab0Sopenharmony_ci    /**
3657777dab0Sopenharmony_ci     * @brief Function pointer.
3667777dab0Sopenharmony_ci     * Configure the predicate to match the specified field and the value not within the given array range.
3677777dab0Sopenharmony_ci     *
3687777dab0Sopenharmony_ci     * This method is similar NOT IN the SQL statement.
3697777dab0Sopenharmony_ci     *
3707777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3717777dab0Sopenharmony_ci     * @param field Indicates the column name in the database table.
3727777dab0Sopenharmony_ci     * @param valueObject Represents a pointer to an {@link OH_VObject} instance.
3737777dab0Sopenharmony_ci     * @return Returns the self.
3747777dab0Sopenharmony_ci     * @see OH_Predicates, OH_VObject.
3757777dab0Sopenharmony_ci     * @since 10
3767777dab0Sopenharmony_ci     */
3777777dab0Sopenharmony_ci    OH_Predicates *(*notIn)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
3787777dab0Sopenharmony_ci
3797777dab0Sopenharmony_ci    /**
3807777dab0Sopenharmony_ci     * @brief Function pointer. Initialize OH_Predicates object.
3817777dab0Sopenharmony_ci     *
3827777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3837777dab0Sopenharmony_ci     * @return Returns the self.
3847777dab0Sopenharmony_ci     * @see OH_Predicates.
3857777dab0Sopenharmony_ci     * @since 10
3867777dab0Sopenharmony_ci     */
3877777dab0Sopenharmony_ci    OH_Predicates *(*clear)(OH_Predicates *predicates);
3887777dab0Sopenharmony_ci
3897777dab0Sopenharmony_ci    /**
3907777dab0Sopenharmony_ci     * @brief Destroy the {@link OH_Predicates} object and reclaim the memory occupied by the object.
3917777dab0Sopenharmony_ci     *
3927777dab0Sopenharmony_ci     * @param predicates Represents a pointer to an {@link OH_Predicates} instance.
3937777dab0Sopenharmony_ci     * @return Returns the status code of the execution..
3947777dab0Sopenharmony_ci     * @see OH_Predicates.
3957777dab0Sopenharmony_ci     * @since 10
3967777dab0Sopenharmony_ci     */
3977777dab0Sopenharmony_ci    int (*destroy)(OH_Predicates *predicates);
3987777dab0Sopenharmony_ci} OH_Predicates;
3997777dab0Sopenharmony_ci
4007777dab0Sopenharmony_ci#ifdef __cplusplus
4017777dab0Sopenharmony_ci};
4027777dab0Sopenharmony_ci#endif
4037777dab0Sopenharmony_ci
4047777dab0Sopenharmony_ci#endif // OH_PREDICATES_H
405