BeetlSQL 3.20.3 发布,流行 Java ORM 工具


  • 修复 @ResultProvider (AutoJsonMapper.class) 注解与自定义 AttributeConvert 注解冲突
@Data
@ResultProvider(AutoJsonMapper.class)
public static class MyUserView {
Integer id;
String name;
DepartmentEntity dept;
@UpdateTime
Date createTime
}
  • FetchOne和FetchMany允许条件注解,但符合一定条件时候才发生Fetch。这样可以避免Hibernate,JPA那些无效关联操作
@Data
@Table(name="sys_order")
@Fetch()
@EqualsAndHashCode(of="id")
public class CustomerOrder3 {
@AutoID
Integer id;
String name;
Integer customerId;
	//如果sql模板执行上下文中包含了"c",参考DynamicFetchEnableOnFunction
@FetchOne(value="customerId",enableOn = "c")
Customer customer;

}
  • SQLResult记录了执行过程中的变量
    selectUsers
    ===
    
     -- @var a = 1;
     select * from user where id = #{id}

    变量a的值可以获取。

SQLResult result =....
Object varA = result.templateContext.getVar("a");

 

maven

<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>beetlsql</artifactId>
<version>3.20.4-RELEASE</version>
</dependency>


BeetlSQL 自主研发自 2015 年,目标是提供开发高效,维护高效,运行高效的数据访问框架,它适用范围广,定制性强,写起数据库访问代码特别顺滑,不亚于 MyBatis。你不想写 SQL 也好,或者想更好地写 SQL 也好,BeetlSQL 都能满足这要求,目前支持的数据库如下
 

  • 传统数据库:MySQL (包括支持 MySQL 协议的各种数据库), MariaDB ,Oralce ,Postgres (包括支持 Postgres 协议的各种数据库), DB2 , SQL Server ,H2 , SQLite , Derby ,神通,达梦,华为高斯,人大金仓,PolarDB,GBase8s,GreatSQL 等
  • 大数据:HBase,ClickHouse,Cassandar,Hive,GreenPlum
  • 物联网时序数据库:Machbase,TD-Engine,IotDB
  • SQL 查询引擎:Drill,Presto,Druid
  • 内存数据库:ignite,CouchBase


    如下测试使用了最新的Hibernate,MyBatis,包含了常用的 orm 操作: 多表联合查询映射(complexMapping),直接执行 sql (executeJdbc), 执行模板 sql (executeTemplate), 执行文件中的模板 sql ( File), 内置插入(insert),Query 调用链 (Query), 翻页查询 (pageQuery), 内置主键查询 (selectById), one2Many 自动关联查询 
     
  • Benchmark                         Mode  Cnt     Score   Error   Units
    JMHMain.beetlsqlComplexMapping   thrpt    2   207.914          ops/ms
    JMHMain.beetlsqlExecuteJdbc      thrpt    2   496.413          ops/ms
    JMHMain.beetlsqlExecuteTemplate  thrpt    2   456.779          ops/ms
    JMHMain.beetlsqlFile             thrpt    2   424.703          ops/ms
    JMHMain.beetlsqlInsert           thrpt    2   254.596          ops/ms
    JMHMain.beetlsqlLambdaQuery      thrpt    2   230.682          ops/ms
    JMHMain.beetlsqlOne2Many         thrpt    2   122.058          ops/ms
    JMHMain.beetlsqlPageQuery        thrpt    2   193.937          ops/ms
    JMHMain.beetlsqlSelectById       thrpt    2   421.610          ops/ms
    JMHMain.jdbcExecuteJdbc          thrpt    2  1041.376          ops/ms
    JMHMain.jdbcInsert               thrpt    2   332.804          ops/ms
    JMHMain.jdbcSelectById           thrpt    2  1048.165          ops/ms
    JMHMain.jpaExecuteJdbc           thrpt    2    92.327          ops/ms
    JMHMain.jpaExecuteTemplate       thrpt    2   136.409          ops/ms
    JMHMain.jpaInsert                thrpt    2    61.157          ops/ms
    JMHMain.jpaOne2Many              thrpt    2    98.182          ops/ms
    JMHMain.jpaPageQuery             thrpt    2   124.133          ops/ms
    JMHMain.jpaSelectById            thrpt    2   295.552          ops/ms
    JMHMain.mybatisComplexMapping    thrpt    2    99.312          ops/ms
    JMHMain.mybatisExecuteTemplate   thrpt    2   212.699          ops/ms
    JMHMain.mybatisFile              thrpt    2   166.106          ops/ms
    JMHMain.mybatisInsert            thrpt    2   152.376          ops/ms
    JMHMain.mybatisLambdaQuery       thrpt    2     9.545          ops/ms
    JMHMain.mybatisPageQuery         thrpt    2    68.617          ops/ms
    JMHMain.mybatisSelectById        thrpt    2   251.361          ops/ms
    JMHMain.weedExecuteJdbc          thrpt    2   402.270          ops/ms
    JMHMain.weedExecuteTemplate      thrpt    2   426.764          ops/ms
    JMHMain.weedFile                 thrpt    2   440.994          ops/ms
    JMHMain.weedInsert               thrpt    2   232.100          ops/ms
    JMHMain.weedLambdaQuery          thrpt    2   335.052          ops/ms
    JMHMain.weedPageQuery            thrpt    2   216.811          ops/ms
    JMHMain.weedSelectById           thrpt    2   359.930          ops/ms
    

     

    阅读文档 源码和例子 在线体验 多库使用 性能测试


相關推薦

2022-07-06

dependency> <groupId>com.ibeetl</groupId> <artifactId>beetlsql</artifactId> <version>3.15.0-RELEASE</version> </dependency>       BeetlSQL 自主研发自 2015 年,目标是提供开发高效,维护高效,运行高效的数据

2022-11-01

dependency> <groupId>com.ibeetl</groupId> <artifactId>beetlsql</artifactId> <version>3.19.3-RELEASE</version> </dependency> BeetlSQL 自主研发自 2015 年,目标是提供开发高效,维护高效,运行高效的数据访问框架,它适用范

2023-02-02

的implementByChild }   I6AWTZ 修复2022年10更新版本导致beetlsql多种数据库库支持的BUG I634BU Spring Boot Starter 打包去掉对commons-dbcp 依赖   I617VE 修复@ResultProvider(AutoJsonMapper.class)注解与自定义AttributeConvert注解冲突 @Data @R

2024-03-01

其增强组件 [ ] jpa [ ] easy-query [ ] wood [ ] sqltoy [ ] beetlsql [ ] ...... 有想扩展其他orm框架和数据库的可加qq群联系群主 代码示例 以下测试代码请详见hh-vue项目中的hh-vue/hh-admin/src/test/java/com/hh/test/service/impl/FlowTest.java

2023-08-05

调整SqlIdFactory实现,使用类全路径名作为sqlId标识 调整BeetlSQL+SpringBoot集成方式,支持SpringBoot3 新增MyBatis-Flex,EasyQuery  俩款ORM工具性能测试 maven <dependency> <groupId>com.ibeetl</groupId> <artifactId>beetlsql</art

2024-03-23

其增强组件 [ ] jpa [ ] easy-query [ ] wood [ ] sqltoy [ ] beetlsql [ ] ...... 有想扩展其他orm框架和数据库的可加qq群联系群主 代码示例 https://gitee.com/min290/hh-vue/blob/master/ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/FlowTest.java 部

2023-07-06

dependency> <groupId>com.ibeetl</groupId> <artifactId>beetlsql</artifactId> <version>3.23.4-RELEASE</version> </dependency>   BeetlSQL 自主研发自 2015 年,目标是提供开发高效,维护高效,运行高效的数据访问框架,它

2023-03-22

配置没启效的问题 修复 LOG_SERVER 属性映射缺陷(pr) beetlsql 升为 3.20.3-RELEASE fastjson2 升为 2.0.25 snack3 升为 3.2.61 hutool 升为 5.8.15 sqltoy 升为 5.2.39 snakeyaml 升为 2.0 项目仓库: gitee:https://gitee.com/noear/solon github:http

2023-04-03

ML标签支持)。 <?xml version="1.0" encoding="UTF-8" ?> <beetlsql> <sql id="testIf"> select * from sys_user where 1=1 <if test="name!=null"> and name != #{name} </if> </sql> <sql id="testIsNotEmpty"> select * from sys_user where 1=1

2023-03-17

  Mybatis Plus      JPA   TK Mybatis   BeetlSQL  

2024-02-08

兼容 MyBatis) LambdaTemplate (高度接近 MyBatis Plus、jOOQ 和 BeetlSQL) @Insert、@Update、@Delete、@Query、@Callable 注解(类似 JPA) 事务支持 支持 5 个事务隔离级别、7 个事务传播行为(与 Spring tx 相同) 提供 TransactionTemplate、Tr

2023-04-23

godb=true application.yml 也是支持的.   Bee V2.1.x 往期发布: https://www.oschina.net/news/235501/bee-2-1-4-5-released https://www.oschina.net/news/226875/bee-2-1-2-1-released https://www.oschina.net/news/230490/bee-2-1-2-28-released https://www.oschina.net/news/231902/javao

2023-05-12

直接支持运行 Mongodb 原生语句     Bee V2.1.x 往期发布: https://www.oschina.net/news/235501/bee-2-1-4-5-released https://www.oschina.net/news/226875/bee-2-1-2-1-released https://www.oschina.net/news/230490/bee-2-1-2-28-released https://www.oschina.net/news/231902/javao

2023-04-06

支持Mongodb创建索引 25)支持Mongodb事务   Bee V2.1.x 往期发布: https://www.oschina.net/news/226875/bee-2-1-2-1-released https://www.oschina.net/news/230490/bee-2-1-2-28-released https://www.oschina.net/news/231902/javaorm-bee-2-1-3-6 https://www.oschina.net/news/232911/bee-sp