当前位置:网站首页>HarmonyOS访问数据库实例(3)--用ORM Bee测下HarmonyOS到底有多牛
HarmonyOS访问数据库实例(3)--用ORM Bee测下HarmonyOS到底有多牛
2022-06-24 19:43:00 【abckingaa】
关于环境搭建,Bee的基本使用,这里就不再介绍了。
有需要,可以查看之前的文章。
HarmonyOS访问数据库实例(ORM方式 ,同一套代码,可同时应用在Android和HarmonyOS )
HarmonyOS访问数据库实例(2)--ORM Bee篇(让开发者只需要关注业务)
一、效果图
首页
二、用ORM Bee操作1万条数据测试性能
简要解释下Suid, SuidRich.
Suid是包含有简单的select,update,insert,delete操作的接口方法。
SuidRich则有更多丰富多样的方法,像复杂查询,批量插入,聚合查询等。
2.1批量插入1w数据
public int testBatchInsert10000Div2() {
Tb_inaccount a;//命名不规范,忽学. 只是为了测更多场景
String addr="aaa";
List<Tb_inaccount> list=new ArrayList<>();
for (int i = 1; i <= 10000; i++) {
a=new Tb_inaccount();
a.setid(i);
a.setMark(addr+i);
a.setMoney(0.618);
list.add(a);
}
return suidRich.insert(list,5000);
}
2.2 查询1w条数据
public void testQuery10000() {
// return suidRich.select(new Tb_inaccount(), 0, 10000);
for (int i = 0; i < 10; i++) { //分10批查
suidRich.select(new Tb_inaccount(), i*10000, 1000);
}
}
2.3 将插入的1w数据都删除了
public int testDelete10000() {
return suidRich.delete(new Tb_inaccount());
}
三、运行并查看结果
1、启动模拟器
2、点击[性能测试] 按钮
性能效果图
这个性能还真不差。看了,你就知道HarmonyOS到底有多牛!!
和其它的平台或工具对比下,就可以看出差距。
源码地址(开源不易,记得点star哦^_^):
ORM Bee 简单易用,文件小,性能好;同时支持 Android 和 Harmony,还支持 JDBC (可在 JavaWeb 等开发中使用)。
在 Harmony 和 Android 两个环境 , 可以用同一套 Bee 代码访问 DB, 提高代码重用,节省人力物。
Bee,互联网新时代的 Java ORM 工具,更快、更简单、更自动,开发速度快,运行快,更智能!
Bee 网址:
https://github.com/automvc/bee
Bee在gitee 的网址:
bee: Bee,互联网新时代的Java ORM框架,更快、更简单、更自动,开发速度快,运行快,更智能!
bee-ext:
https://github.com/automvc/bee-ext
边栏推荐
- Detailed explanation of online group chat and dating platform project (servlet implementation)
- Dig deep into MySQL - resolve the clustered index / secondary index / federated index of InnoDB storage engine
- Laravel creates a service layer
- Selection (028) - what is the output of the following code?
- laravel 验证器的使用
- Pousser l'information au format markdown vers le robot nail
- 推送Markdown格式信息到釘釘機器人
- MySQL kills 10 people. How many questions can you hold on to?
- [JS] - [stack, team - application] - learning notes
- 監聽 Markdown 文件並熱更新 Next.js 頁面
猜你喜欢
Online group chat and dating platform test point
第六章 网络学习相关技巧5(超参数验证)
JD 618 conference tablet ranking list announced that the new dark horse brand staff will compete for the top three, learning from Huawei, the leader of domestic products
Laravel pagoda security configuration
【基础知识】~ 半加器 & 全加器
【js】-【数组、栈、队列、链表基础】-笔记
[basic knowledge] ~ half adder & full adder
Tech talk activity review kubernetes skills of cloud native Devops
Pousser l'information au format markdown vers le robot nail
2022 simulated 100 questions and simulated examination of high-altitude installation, maintenance and demolition
随机推荐
案例解析:用「度量」提升企业研发效能|ONES Talk
UNION ALL UNION FULL JOIN
Use of laravel verifier
[JS] - [linked list - application] - learning notes
The large-scale market of graduate dormitory! Here comes the enviable graduate dormitory!
[basic knowledge] ~ half adder & full adder
Blogs personal blog project details (servlet implementation)
379. 捉迷藏
Laravel study notes
Force deduction solution summary 515- find the maximum value in each tree row
07_SpingBoot 实现 RESTful 风格
RT-thread使用rt-kprintf
Financial management [5]
laravel 宝塔安全配置
Attention, postgraduate candidates! They are the easiest scams to get caught during the preparation period?!
伪原创智能改写api百度-收录良好
Building Survey [2]
Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training
UNION ALL UNION FULL JOIN
Whereabouts computer desktop small arrow