• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Data Operation:DsHint(Specify Data Source) and BatchSizeHint(Specify Batch Quantity)


Ⅰ、Scenario Description

  • DsHintApi, which forces the specification of the data source,
  • BatchSizeHintApi, which forces the specification of the query batch quantity

Ⅱ、API Definition

(Ⅰ) DsHintApi

public static DsHintApi model(String model/**Model Code*/) {
    // Specific implementation
}

public DsHintApi(Object dsKey/**Data Source Name*/) {
    // Specific implementation
}

(Ⅱ) BatchSizeHintApi

public static BatchSizeHintApi use(Integer batchSize) {
    // Specific implementation
}

Ⅲ、Usage Examples

Caution

Warning:

The try-with-resources syntax is used in the code; otherwise, data source confusion may occur.

  • DsHintApi Usage Example All queries wrapped inside the try block will be forced to use the specified data source.
  // Usage Mode 1:
  try (DsHintApi dsHintApi = DsHintApi.model(PetItem.MODEL_MODEL)) {
       List<PetItem> items = demoItemDAO.customSqlDemoItem();
       PetShopProxy data2 = data.queryById();
       data2.fieldQuery(PetShopProxy::getPetTalents);
 }

  // Usage Mode 2:
 try (DsHintApi dsHintApi = DsHintApi.use("Data Source Name")) {
        List<PetItem> items = demoItemDAO.customSqlDemoItem();
        PetShopProxy data2 = data.queryById();
        data2.fieldQuery(PetShopProxy::getPetTalents);
 }
  • 3、BatchSizeHintApi Usage Example All queries wrapped inside the try block will be executed according to the specified batchSize.
// Specify to query 500 records each time
try (BatchSizeHintApi batchSizeHintApi = BatchSizeHintApi.use(500)) {
    PetShopProxy data2 = data.queryById();
    data2.fieldQuery(PetShopProxy::getPetTalents);
}
// Specify no pagination (batchSize=-1) for the query. Please note that you must use this when it is clear that pagination is not needed; if the data volume is extremely large and no pagination is used, it may cause a freeze. By default, the platform will perform pagination queries when the number of pages is not specified.
try (BatchSizeHintApi batchSizeHintApi = BatchSizeHintApi.use(-1)) {
    PetShopProxy data2 = data.queryById();
    data2.fieldQuery(PetShopProxy::getPetTalents);
}
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Search Enhancement:Oinone Introduces Search Engine (Enhanced Model)
Next
Search Enhancement:Common Problem Solutions for Introducing Search Enhancement Model Channel
默认页脚
Copyright © 2026 Mr.Hope