Bee is an AI, easy and high efficiency ORM framework,support JDBC,Cassandra,Mongodb,Sharding,Android,HarmonyOS.
Easy for Stronger.
Bee is an ORM framework.
Bee is an easy and high efficiency ORM framework.
Coding Complexity is O(1),it means that Bee will do the Dao for you.
You don't need to write the Dao by yourself anymore.Help you to focus more on the development of business logic.
Good Feature: AI, Timesaving/Tasteful, Easy, Automatic (AiTeaSoft Style)
Newest version is:Bee V2.2 LTS
Sharding target: It is mainly transparent to business development and coding, with only a little sharding config.
Bee see:
https://github.com/automvc/bee
bee-ext:
https://github.com/automvc/bee-ext
Easy to use:
Automatic, powerful:
7.the Sharding template method class uses finally to handle context recycling
8.MapSql(MapSuid)supports using Condition to implement more complex where conditions, with updateSet set values
MapSql add methods: public void where(Condition condition);
public void updateSet(Condition condition);
9.add ConditionExt to support the use of entity::getName to reference property
10.add ChainSqlFactory
V2.2(2024.1.1·LTS)
V2.1.10(2023.10)
1.support SQL not ("!")
2.support OceanBase
3.doBeforeReturn with finally
4.clear cache when change dataSource map
5.multiple data source configurations, dbs supports multiple environment coverage configurations
6.support read bee.db.url and other information from application.properties of springboot when use in main method
7.fixed bug:two properties item(notSupportUnionQuery,executorSize)have not prefix "sharding_"
V2.1.8(2023.Mid-Autumn Festival & National Day)
1.
1.1 Make the spring boot command line compatible with active profile selection, for example: java -jar springbootDemo.jar --spring.profiles.active=dev, which will trigger bee-dev.properties.
1.2 Make the spring boot data source configuration compatible, such as spring.datasource.url.
1.3 When not starting the application directly running the main method, if bee.properties does not have a data source configuration, it should be able to use the single data source configuration in application.properties of spring boot.
2. Perform insert, update, and delete operations on multiple table associations.
3. Add date format validation and calculate age in DateUtil.
4. Fix the bug in the CurrencyArithmetic variable.
5. Make the table name in CacheSuidStruct case-insensitive.
6. Improve the interceptor and context information management in MongodbObjSQLRichExt.
7. Support creating tables through Excel for more Database.
8. In Mongodb logging, when querying all fields, by default, the fields to be queried are not displayed. This can be controlled by the bee.osql.showMongoSelectAllFields configuration.
9. Provide a default BeeSimpleDataSource that supports configuring multiple data sources in bee.properties (even without using spring boot). When using Bee alone, the DataSourceBuilderFactory can also start automatically.
10. Support generating Swagger annotations for Javabean.
11. GridFs annotation support select type for MongoDB, GridFs file type support byte[]
V2.1.7
1.support showExecutableSql sql format(requires configuration: bee.osql.showSql.sqlFormat=true)
2. Support random expiration time for second-level cache to solve cache avalanche issue.
3. DdlViaExcel.createTable allows creating database tables using information from an Excel file, with the option to create only specific tables.
4. Support for Spring Boot 3.0.8
5. Enhance Sharding ThreadPool to allow custom configuration of the size of threads for Sharding operations.
6. Improve handling of multi-threaded operations for obtaining SQLiteDatabase in Android.
V2.1.6
1.add switch closeDefaultParaResultRegistry
2.support JAP new API package jakarta.persistence.*
3.catchModifyDuplicateException for batch insert
4.close UtilDotDateTypeConvert because it miss HH:mm:ss
5.fixed bug update the defalut value for cofig item
fixed bug NullPointerException for PreparedSql preparedValue
fixed bug for StringUtils
Test Evn : Local windows.
DB: MySQL (Version 5.6.24).
Test point: Batch Insert;Paging Select; Transaction(update and select).
Batch Insert(unit: 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 Select(unit: ms) |
|||||
20 | 50 | 100 | 200 | 500 | |
Bee | 17.33 | 58.67 | 52.33 | 38.33 | 57.33 |
MyBatis | 314.33 | 446.00 | 1546.00 | 2294.33 | 6216.67 |
Transaction(update and select) (unit: ms) |
|||||
20 | 50 | 100 | 200 | 500 | |
Bee | 1089.00 | 70.00 | 84.00 | 161.33 | 31509.33 |
MyBatis | 1144 | 35 | 79.67 | 146.00 | 32155.33 |
Bee need files
orm\compare\bee\service\BeeOrdersService.java
MyBatis need files
orm\compare\mybatis\service\MybatisOrdersService.java
orm\compare\mybatis\dao\OrdersDao.java
orm\compare\mybatis\dao\OrdersMapper.java
orm\compare\mybatis\dao\impl\OrdersDaoImpl.java
common,Javabean and Service interface:
Orders.java
OrdersService.java
Performance comparison data of Bee application in app development
Operate 10000 records, and the use time comparison is as follows.
Operate 10000 records(unit: ms) |
|||
insert | query | delete | |
greenDao(Android) | 104666 | 600 | 47 |
Bee(Android 8.1) | 747 | 184 | 25 |
Bee(HarmonyOS P40 Pro simulator) | 339 | 143 | 2 |
<dependency>
<groupId>org.teasoft</groupId>
<artifactId>bee-all</artifactId>
<version>2.2</version>
</dependency>
<!-- Mysql config.You need change it to the real database config. -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
<scope>runtime</scope>
</dependency>
Gradle
implementation group: 'org.teasoft', name: 'bee-all', version: '2.2'
//Gradle(Short)
implementation 'org.teasoft:bee-all:2.2'
eg:
Create one database,default name is bee.
Create the tables and init the data by run the init-data(user-orders)-mysql.sql file(it is mysql sql script).
If no the bee.properties file, you can create it by yourself.
#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.url =jdbc:mysql://127.0.0.1:3306/bee?characterEncoding=UTF-8&useSSL=false
bee.db.username = root
bee.db.password =
#print log
bee.osql.showSQL=true
bee.osql.showSql.showType=true
bee.osql.showSql.showExecutableSql=true
# since 2.1.7 sqlFormat=true,will format the executable sql
bee.osql.showSql.sqlFormat=false
#log4j>slf4j>log4j2>androidLog>harmonyLog>systemLogger>fileLogger>noLogging>jdkLog>commonsLog
bee.osql.loggerType=systemLogger
Orders(Javabean)
Auto Genernate Javabean
import java.math.BigDecimal;
import java.util.List;
import org.teasoft.bee.osql.BeeException;
import org.teasoft.bee.osql.Suid;
import org.teasoft.honey.osql.core.BeeFactoryHelper;
import org.teasoft.honey.osql.core.Logger;
/**
* @author Kingstar
* @since 1.0
*/
public class SuidExamEN {
public static void main(String[] args) {
try {
Suid suid = BeeFactoryHelper.getSuid();
Orders orders1 = new Orders();//need gen the Javabean
orders1.setId(100001L);
orders1.setName("Bee(ORM Framework)");
List<Orders> list1 = suid.select(orders1); // 1. select
for (int i = 0; i < list1.size(); i++) {
Logger.info(list1.get(i).toString());
}
orders1.setName("Bee(ORM Framework)");
int updateNum = suid.update(orders1); //2. update
Logger.info("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
int insertNum = suid.insert(orders2); // 3. insert
Logger.info("insert record:" + insertNum);
int deleteNum = suid.delete(orders2); // 4. delete
Logger.info("delete record:" + deleteNum);
} catch (BeeException e) {
Logger.error("In SuidExamEN (BeeException):" + e.getMessage());
//e.printStackTrace();
} catch (Exception e) {
Logger.error("In SuidExamEN (Exception):" + e.getMessage());
//e.printStackTrace();
}
}
}
// notice: this is just a simple sample. Bee suport transaction,paging,complicate select,slect json,and so on.
bee.db.isAndroid=true
bee.db.androidDbName=account.db
bee.db.androidDbVersion=1
bee.osql.loggerType=androidLog
#turn on query result field type conversion, and more types will be supported
bee.osql.openFieldTypeHandler=true
#If you are allowed to delete and update the whole table, you need to remove the comments
#bee.osql.notDeleteWholeRecords=false
#bee.osql.notUpdateWholeRecords=false
public class YourAppCreateAndUpgrade implements CreateAndUpgrade{
@Override
public void onCreate() {
// You can create tables in an object-oriented way
Ddl.createTable(new Orders(), false);
Ddl.createTable(new TestUser(), false);
}
@Override
public void onUpgrade(int oldVersion, int newVersion) {
if(newVersion==2) {
Ddl.createTable(new LeafAlloc(), true);
Log.i("onUpgrade", "你在没有卸载的情况下,在线更新到版本:"+newVersion);
}
}
}
Configure android:name to BeeApplication in AndroidManifest.xml file.
package com.aiteasoft.util;
import org.teasoft.bee.android.CreateAndUpgradeRegistry;
import org.teasoft.beex.android.ApplicationRegistry;
public class BeeApplication extends Application {
private static Context context;
@Override
public void onCreate() {
ApplicationRegistry.register(this);//注册上下文
CreateAndUpgradeRegistry.register(YourAppCreateAndUpgrade.class);
}
}
// 并在AndroidManifest.xml,配置android:name为BeeApplication
<application
android:icon="@drawable/appicon"
android:label="@string/app_name"
android:name="com.aiteasoft.util.BeeApplication"
>
Suid suid=BF.getSuid();
List<Orders> list = suid.select(new Orders());
Performance comparison data of Bee application in app development
Operate 10000 records, and the use time comparison is as follows.
Operate 10000 records(unit: ms) |
|||
insert | query | delete | |
greenDao(Android) | 104666 | 600 | 47 |
Bee(Android 8.1) | 747 | 184 | 25 |
Bee(HarmonyOS P40 Pro simulator) | 339 | 143 | 2 |
V2.1
Let Java more quicker programming than php and Rails.
Faster development of new combinations for Java Web:
Bee+Spring+SpringMVC
Faster development of new combinations for Spring Cloud microservices:
Bee + Spring Boot
Rapid Application Code Generation Platform--AiTea Soft made in China!
...
API-V1.17(Newest) SourceCode contain bee-1.17 CN & EN API,bee-1.17 CN SourceCode
In order to provide more and more powerful functions, Bee team cooperates with the enterprise to launch the Enterprise Version.
We hope to provide more easy-to-use Bee functions to further improve the efficiency of development!
Enterprise users:
USD 199.00
Personal users:
USD 49.00
Permanent use after purchase,Get upgrades for free
The use of Enterprise Edition, professional technical support and solution consultation are provided by the following companies:
Shenzhen Caifeng software
(Enterprises willing to join in, please contact us!)