This release adds a thoughtful feature that can limit the length of SQL in the Mapper method to avoid excessively long SQL that is difficult to maintain
- Configure the attribute MAPPER_SQL_MAX_LENGTH to limit the SQL length in the Mapper, which is not limited by default
- The ID automatically generated by the code uses @AssingID
Whether it is JAP, SpringData, MyBatis, or BeetSQL, it supports the use of annotations to specify SQL statements in Mapper. Take BeetlSQL as an example
@Sql("select * from user where dept_id=?")
List<User> selectByDept(Integer deptId);
@Template("select * from user where dept_id=#{deptId}")
List<User> selectByDept2(Integer deptId);
In principle, sql statements should be kept as short as possible, and long sql statements should be maintained in files. BeetlSQL provides a run-time detection of the length of the SQL statement, if it is too long, it will refuse to execute.
<dependency>
<groupId>com.ibeetl</groupId>
<artifactId>beetlsql</artifactId>
<version>3.2.8-RELEASE</version>
</dependency>
BeetlSQL's goal is to provide a database access framework that is efficient in development, maintenance, and operation. The framework is based on my 20 years of experience in telecommunications, finance and Internet CRUD, and it has a wide range of applications. The currently supported databases are as follows
- Traditional databases: MySQL, MariaDB, Oralce, Postgres, DB2, SQL Server, H2, SQLite, Derby, Magic Power, Dream, Huawei Goss, Renda Jincang, PolarDB, etc.
- Big data: HBase, ClickHouse, Cassandar, Hive
- IoT time series database: Machbase, TD-Engine, IotDB
- SQL query engine: Drill, Presto, Druid
- In-memory database: ignite, CouchBase
The transaction supports local and global, as well as Saga transactions, and can also cooperate with third-party transaction managers.