当前位置:网站首页>Bee framework, an ORM framework that can be learned in ten minutes --bee
Bee framework, an ORM framework that can be learned in ten minutes --bee
2022-06-22 08:15:00 【abckingaa】
Bee It's a ORM frame . Focus on : To save time / grace 、 Simple and easy 、 Automatically ( Tea: Timesaving/Tasteful, Easy, Automatic) characteristic . Reduce the amount of coding for developers , Just for one purpose -- Let others stop calling us code farmers ! Give Way Bee Become the tea of endless aftertaste in the hands of software engineers ! sample tea , Product software !
Bee More than others JAVA Of ORM frame , class ORM The framework should be easy to use , Easy to use . You can learn to use it in ten minutes . And for many new requirements, there is no need to add interfaces or change sql The configuration file .Bee Of Coding complexity by O(1).
If a worker wants to do a good job, he must sharpen his tools first !——《 The analects of Confucius · Wei linggong 》
Bee Introduction to main functions and features :
Bee Simple concept (10 Minutes to get started )、 Powerful .
Bee Simplify and DB Interactive coding workload . Connect , Transactions can be handled by Bee The framework is responsible for managing .
To save time , Fast development speed
Simple and easy to use
- 1. The interface is simple , Easy to use .Suid The interface corresponds to SQL Linguistic select,update,insert,delete Operation provides 4 A method with the same name .
- 2. Used Bee, You don't have to write anything else dao Code , Call directly Bee Of api To complete the DB The operation of .
- 3. Convention over configuration :Javabean There is no comment , Don't need to, xml The mapping file , It's just pure Javabean that will do , even to the extent that get,set The method is not necessary .
- 4. Intelligent automatic filtering null And empty string , No longer need to write code to judge non empty .
- 5. Support Query only part of the fields .
Automatically , Powerful work
- 6. dynamic / Arbitrary combination Query criteria , There's no need to prepare in advance dao Interface , There is no need to modify or add interfaces when there are new query requirements .
- 7. Support native SQL Sort , Native statement paging ( There's no need to look up all the data ).
- 8. Support Go straight back to Json Format query results ; Chain programming .
- 9. Support Business 、 Multiple ORM The operation uses the same connection 、for update, Support The batch operation , Support native SQL( Customize sql sentence ), Support stored procedure .
- 10. Support object-oriented complex query 、 Multi-table query ( nothing n+1 problem ; Support : one-on-one , One to many , For one more , Many to many ).
- 11. First level cache , Simple concept , Powerful ; L1 cache can also image JVM Fine grained tuning as well ; Support updatable long-term cache list , Update configuration table , No need to reboot .
- 12. Table name and entity name 、 The mapping between field name and attribute name provides multiple implementations by default , And support Custom mapping rule extension .
- 13. Varied DB Support easy expansion (MySQL,MariaDB,Oracle,H2,SQLite,PostgreSQL,SQL Server And so on ).
- 14. Support Read / write separation One master, many followers , only sub-treasury etc. Multiple data sources Pattern ( There is no need to modify the previous code , This function is transparent to the code , That is, no additional coding is required ), Multiple types of databases can be used at the same time .
- 15. Distributed Generate... In an environment Continuously monotonically increasing ( In a workerid Inside ), Globally unique Numbers id; Provide a natural and simple distributed primary key generation method .
- 16. Support the same database sub table , Dynamic table name mapping .
- 17. You don't need the corresponding table Javabean Can also operate DB.
- 18. nothing Third party plug-ins depend on ; It can be used with zero configuration .
- 19. Good performance : near JDBC The speed of ; The file is small :Bee V1.8 jar only 217k, V1.9.5 jar, only 315k.
Auxiliary function : - 20. Support automatic generation of the corresponding table Javabean, according to Javabean Create table ,Javaweb Back end code according to The template is generated automatically ; Can print non placeholder Executable sql, Convenient debugging .
- 21. Support Read Excel, from Excel Import data to DB, It's easy to operate .
Bee Open source , Open source address :
GitHub - automvc/bee: Bee is an AI, easy and high efficiency ORM framework.
Bee At the code cloud website :
bee: The new era of the Internet Java ORM Tools , Simple 、 Efficient , Fast development speed !
It also provides a lot of information related to SpringMVC, Spring Boot Related examples of ( Please check out : Comprehensive application part )
The following is a detailed introduction :
The latest version V1.9.8 (2021-11)
V1.9.5 (2021-05)
Detailed and complete function introduction
Click on the link to view Detailed and complete function introduction
ORM Compare
Test environment : Windows.
database : MySQL (Version 5.6.24).
Test point : Batch insert ; Paging query ; Business (update and select).

Batch insert ( Company : ms) | |||||
| 5k | 1w | 2w | 5w | 10w | |
| Bee | 529.00 | 458.33 | 550.00 | 1315.67 | 4056.67 |
| MyBatis | 1193 | 713 | 1292.67 | 1824.33 | Exception |
Paging query ( Company : ms) | |||||
| 20 Time | 50 Time | 100 Time | 200 Time | 500 Time | |
| Bee | 17.33 | 58.67 | 52.33 | 38.33 | 57.33 |
| MyBatis | 314.33 | 446.00 | 1546.00 | 2294.33 | 6216.67 |
Business (update and select) ( Company : ms) | |||||
| 20 Time | 50 Time | 100 Time | 200 Time | 500 Time | |
| Bee | 1089.00 | 70.00 | 84.00 | 161.33 | 31509.33 |
| MyBatis | 1144 | 35 | 79.67 | 146.00 | 32155.33 |
Quick start :
1. introduce Bee
1.1 maven engineering , Add the following dependencies
<dependency>
<groupId>org.teasoft</groupId>
<artifactId>bee</artifactId>
<version>1.9.8</version>
</dependency>
<dependency>
<groupId>org.teasoft</groupId>
<artifactId>honey</artifactId>
<version>1.9.8</version>
</dependency>
<!--for log framework,Excel(poi) -->
<dependency>
<groupId>org.teasoft</groupId>
<artifactId>bee-ext</artifactId>
<version>1.9.8</version>
</dependency>1.2 It can also be downloaded directly jar file
2. Create databases and tables
Examples are as follows :
Create a database , The default name is bee.
It can be used init-data(user-orders)-mysql.sql Scripts create tables and insert initialization data .
3. Update the configuration information of the database ( stay bee.properties)
notes : If not bee.properties file , You can create a new .
You can also configure data sources ( This is just an example ).
//#bee.databaseName=MySQL
bee.db.dbName=MySQL
bee.db.driverName = com.mysql.jdbc.Driver
bee.db.url =jdbc:mysql://localhost:3306/bee?characterEncoding=UTF-8
bee.db.username = root
bee.db.password =
4. Generate Javabean Orders May refer to :
Orders(Javabean)
Auto Genernate Javabean
5. Run the following java Code
import java.math.BigDecimal;
import java.util.List;
import org.teasoft.bee.osql.Suid;
import org.teasoft.honey.osql.core.BeeFactoryHelper;
/**
* check , Change , increase , Delete Suid (select,update,insert,delete) example
* @author Kingstar
* @since 1.0
*/
public class SuidExam {
public static void main(String[] args) {
Suid suid=BeeFactoryHelper.getSuid();
// You need to become the corresponding Javabean
Orders orders1=new Orders();
orders1.setId(100001L);
orders1.setName("Bee(ORM Framework)");
//1:select Query instance
// Default not to handle null And empty string . No more judgments ; All other fields with values are automatically used as filtering conditions
List<Orders> list1 =suid.select(orders1); //select
for (int i = 0; i < list1.size(); i++) {
System.out.println(list1.get(i).toString());
}
//2:update Update instance
orders1.setName("Bee--ORM Framework");
// By default, only the fields that need to be updated are updated . By default, only id Field , Other requirements are available SuidRich The method in .
int updateNum=suid.update(orders1); //update
System.out.println("update record:"+updateNum);
Orders orders2=new Orders();
orders2.setUserid("bee");
orders2.setName("Bee(ORM Framework)");
orders2.setTotal(new BigDecimal(91.99));
orders2.setRemark(""); //empty String test
//3:insert Insert instance
int insertNum=suid.insert(orders2); //insert
// Default not to handle null And empty string . No more judgments ; All other fields with values are automatically inserted into the database .
// Easy to combine DB interpolation , Such as id Automatic growth , from DB Insert ;createtime from DB Default insert
System.out.println("insert record:"+insertNum);
//4:delete Delete the instance
// Default not to handle null And empty string . No more judgments ; All other fields with values are automatically used as filtering conditions
//int deleteNum=suid.delete(orders2); //delete
//System.out.println("delete record:"+deleteNum);
}
}
// Be careful : Business , Pagination , Sort , Range queries , The query results directly return json Such as support , Here is just an introductory example .
// More application reference , Please check out : More examples and Comprehensive application .Comprehensive application :
Java Rapid programming , Give Way Java The development speed of php and Rails.
Faster development Java Web A new combination of :
Bee+Spring+SpringMVC
Including only sub database multi data source instances
Faster development Spring Cloud A new combination of microservices :
Bee + Spring Boot
......
FAQ common problem
Click on the link to view FAQ common problem
E-mail address of the author email: [email protected]
If you have any suggestions , Welcome to email the author , Thank you for !
In order to answer your questions in time , You can join Bee Technology QQ Group :992650213
meanwhile , You are also welcome to join Bee The development of the framework , I believe you will join us ,Bee It will be better !

Long press the QR code to follow
More articles are waiting for you !
边栏推荐
- The solution to the problem of the first screen picture loading flicker
- QT control adds double click event
- swagger中的枚举、自定义类型和swaggerignore
- golang中使用swagger遇到的一些问题
- Mt4-mql4 language EA automatic transaction programming introduction to proficiency
- 成为一名卓越云架构师要具备的五项技能
- Chmod Chmod command
- SQL triggers
- Kubernetes practice
- Collections以及Arrays
猜你喜欢
On Fresnel phenomenon

Learn data warehouse together - Zero

What is distributed transaction
关于菲涅尔现象

并发三大特性1-可见性

Mt4/mql4 getting started to mastering EA tutorial lesson 8 - common functions of MQL language (VIII) - common time function

Use of keepalived high availability cluster

Mt4/mql4 getting started to mastering EA tutorial lesson 3 - common functions of MQL language (III) - common functions of K-line value taking

【Oracle 数据库】奶妈式教程 day13 日期函数

歪门邪道之解决首屏图片加载闪烁问题
随机推荐
Oracle database pl/sql procedure body, cursor, stored procedure
Note pad replaces all contents after a character in all lines
Energy and interference of waves
Mt4/mql4 getting started to proficient in foreign exchange EA automatic trading tutorial - special identification of the K line on the chart
Summary of basic knowledge of Oracle database SQL statements I: Data Definition Language (DDL)
JSON usage example
Node red sends wechat official account message (template message)
[songhongkang MySQL database] [advanced chapter] [07] MySQL storage engine
【Oracle 数据库】奶妈式教程 day13 日期函数
并发三大特性1-可见性
Dom4j+xpath parsing XML files
Collections以及Arrays
Mt4/mql4 getting started to proficient in foreign exchange EA automatic trading tutorial - common functions of MQL language
SVN 提交子文件夹问题
Idea reports an error "insufficient memory"
Example of using listagg in Oracle 11g (splicing the values of a field into a line, separated by commas)
QT custom composite control (class promotion function)
C语言实现往MySQL插入和读取图片
【Oracle 数据库】奶妈式教程 day12 字符函数
Square array cyclic right shift