All Projects → automvc → Bee

automvc / Bee

Licence: apache-2.0
Bee is an AI, easy and high efficiency ORM framework.

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Bee

Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (-20.47%)
Mutual labels:  orm
Gnorm
A database-first code generator for any language
Stars: ✭ 415 (-11.51%)
Mutual labels:  orm
Dynamoid
Ruby ORM for Amazon's DynamoDB.
Stars: ✭ 449 (-4.26%)
Mutual labels:  orm
Hutool
🍬A set of tools that keep Java sweet.
Stars: ✭ 21,386 (+4459.91%)
Mutual labels:  orm
Sqlboiler
Generate a Go ORM tailored to your database schema.
Stars: ✭ 4,497 (+858.85%)
Mutual labels:  orm
Antdata.orm
特色:vs插件或者t4一键生成entity 支持配置非物理外键。分离linq转sql引擎(原生linq非扩展)和执行dal功能,支持异步,支持netcore2.0
Stars: ✭ 428 (-8.74%)
Mutual labels:  orm
Baby squeel
🐷 An expressive query DSL for Active Record 4 and 5
Stars: ✭ 362 (-22.81%)
Mutual labels:  orm
Nohm
node.js object relations mapper (orm) for redis
Stars: ✭ 462 (-1.49%)
Mutual labels:  orm
Sonatadoctrineormadminbundle
Integrate Doctrine ORM into the SonataAdminBundle
Stars: ✭ 400 (-14.71%)
Mutual labels:  orm
Zapatos
Zero-abstraction Postgres for TypeScript: a non-ORM database library
Stars: ✭ 448 (-4.48%)
Mutual labels:  orm
Hibernate Search
Hibernate Search: full-text search for domain model
Stars: ✭ 382 (-18.55%)
Mutual labels:  orm
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (-18.12%)
Mutual labels:  orm
Sqlalchemy Mixins
Active Record, Django-like queries, nested eager load and beauty __repr__ for SQLAlchemy
Stars: ✭ 441 (-5.97%)
Mutual labels:  orm
Elasticsearch
The missing elasticsearch ORM for Laravel, Lumen and Native php applications
Stars: ✭ 375 (-20.04%)
Mutual labels:  orm
Beam
A type-safe, non-TH Haskell SQL library and ORM
Stars: ✭ 454 (-3.2%)
Mutual labels:  orm
Simpleflatmapper
Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper
Stars: ✭ 370 (-21.11%)
Mutual labels:  orm
Framework Learning
计算机学习资料(Java , Jvm , Linux , Mysql , Netty , Redis , Netty , Spring , SpringBoot , Mybatis , Rabbitmq ,计算机网络 , 数据结构与算法 , 设计模式 )Github网页阅读:https://guang19.github.io/framework-learning , Gitee网页版阅读: https://qsjzwithguang19forever.gitee.io/framework-learning
Stars: ✭ 416 (-11.3%)
Mutual labels:  orm
Jooq
jOOQ is the best way to write SQL in Java
Stars: ✭ 4,695 (+901.07%)
Mutual labels:  orm
Toucan
A classy high-level Clojure library for defining application models and retrieving them from a DB
Stars: ✭ 456 (-2.77%)
Mutual labels:  orm
Android Orma
An ORM for Android with type-safety and painless smart migrations
Stars: ✭ 442 (-5.76%)
Mutual labels:  orm

Bee

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.
Good Feature: AI, Timesaving/Tasteful, Easy, Automatic (AiTeaSoft Style)
Bee see:
https://github.com/automvc/bee
or:
https://gitee.com/automvc/bee

中文介绍

点击链接可查看中文介绍

Requirement

jdk1.7+

Feature & Function:

Support many Database(MySQL,MariaDB,Oracle,H2,SQLite,PostgreSQL and so on) and easy extend。

V1.0
Single entity(table) Suid (select,update,insert,delete) object-oriented operation.
Automatically generate the Javabean via DB table or view.
Convention-over-configuration:Javabean no annotation,no xml.
Automatically mapping the table column and the Javabean field.
Javabean support the raw type:int,double,and so on.
PreparedStatement support.
Procedure support.
Native SQL support.
Batch operate support.
Transaction support.
Automatic filter the null and empty field for default.
MAX,MIN,SUM,AVG,COUNT support.
Order by,Paging.
Select some field.
Dynamic & random combination of query conditions,no need to prepare the interface in advance; new query requirements, no need to change the query interface.
All Suid(select,update,insert,delete) operation use the same Bee interface,no longer need any new dao interface.
Users/Developer only need to pay attention to the Bee interface.

......

V1.8
Add Distributed Feature:
1.Add multi-DataSource support(Write/Read, only Split Database).
add multi-DataSource no need change the Java code.
add the route interface of multi-Datasource.
add multi-DataSource route.
add multi-DataSource config.
support refresh multi-DataSource config information.
2.Generate global unique id number in distributed environment.
3.Generate Serial Unique id number in one workid of distributed environment.
Independent clock,workerid can config and easily expand.
Implement algorithms:SerialUniqueId,OneTimeSnowflakeId,PearFlowerId.
Support GenId Factory,and can config the id generator.
4.Gen Serial Unique Id for all Table's Long Id field as primary key.
Enhance Function:
5.The same database sub table support, dynamic table name mapping support.
Entity and any table name mapping support.
Suid add one method: public Suid setDynamicParameter(String para,String value);
add 2 annotation:@Table,@Entity.
6.Use 'for update' lock some select record(s).
public Condition forUpdate()
7.Added support for advanced update set,
Complex query and multi table query support only project some fields.
Add 5 methods in Condition
8.Support show type of data in sql and show ExecutableSql:
bee.osql.showSQL.showType=false
bee.osql.showSQL.showExecutableSql=false
9.Add one method in SuidRich
Add three methods in PreparedSql
10.Oracle DATE column mapping to Timestamp,fix the problem:miss the hour,minute,second in Oracle DATE column.
11.GenFiles support upper case first letter,eg: #{entityName?up1}.
Fix bug:
12.fixed cache bug:genkey;clear cache for batch insert.
fixed bug:parse the json has extra comma. fixed null bug about:PreparedSql's method select(String sql,Object preValues[]).

v1.8.15(2020-10-01 3Festivals)
1.Enhance support for H2,SQLite,PostgreSQL.
2.Enhance page funtion,paging para also use placeholder.
3.Can be used in zero configuration.
4.Enhance PearFlowerId algorithm that it will produce even number with continuous mantissa of 0 when is often not used (there are no such defect in SerialUniqueId and OneTimeSnowflakeId).
5.Enhance Log function.
6.Fixed json transform bug.

v1.8.99(2020-10-25 Double Ninth Festival)
1.Support lower and upper case option for SQL KeyWord.
2.Cache sql key support MD5 string.
3.Optimize the way of setting DB information with Honeyconfig.
4.Fix bug about checkSelectField.

V1.9
SuidRich add new methods support list parameter in batch insert.
enhance SuidRich function, SuidRich add method:
public List<String[]> selectString(T entity,Condition condition);
public int updateById(T entity,Condition condition);
public String selectWithFun(T entity, FunctionType functionType, String fieldForFun, Condition condition);
public int count(T entity);
public int count(T entity, Condition condition);
SuidRich adjust methods selectById for unique entity and intelligently judge the Javabean id type of string id parameter.
enhance aggregate function cont,sum,avg,min,max,Condition add method:
public Condition selectFun(FunctionType functionType,String fieldForFun);
public Condition selectFun(FunctionType functionType,String fieldForFun,String alias);
Condition add method:opWithField,setWithField support like :field1=field2
no Javabean, use map to set the entity information that needs to be transformed and operate the database(select/delete record).
support read excel(.xls,.xlsx), converting data into List<String[]> and importing them into database(bee-ext).
more table join select support more join condition.
same Connection for some ORM operation.
IncludeType support exclude " ".
add Ignore Annotation, ignore the field which do not want to transfer.
support define start and end token when generate file by template.
enhance DB conn management.
enhance code quality.
enhance chain coding:Select,Update.
update batchSize(bee.osql.insert.batchSize) in bee.properties.
fix the problem that the fields with the same name will be confused in some databases(oracle) when multi table paging query.
fixed: update is default by id,but no id field or id is null,will have exception.
fixed: cache bug.
when entity is view(not table), recommend put in bee.osql.cache.never(bee.properties).

Function Detail

click for: Function Detail

ORM Compare

ORM-Compare (More Detail)

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

Quick Start:

1. Add Bee

1.1 if it is a maven project,add the following dependency

		<dependency>
			<groupId>org.teasoft</groupId>
			<artifactId>bee</artifactId>
			<version>1.8.99</version>
		</dependency>
		<dependency>
			<groupId>org.teasoft</groupId>
			<artifactId>honey</artifactId>
			<version>1.8.99</version>
		</dependency>
		<!--for log framework,web sql -->
		<dependency>
			<groupId>org.teasoft</groupId>
			<artifactId>bee-ext</artifactId>
			<version>1.8.99</version>
		</dependency>

1.2 Of course, can download the jar file directly

2. Create the database and the table

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).

3. Update the database configuration in bee.properties if need

If no the bee.properties file, you can create it by yourself.

bee.databaseName=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. The Javabean Orders reference as below:

Orders(Javabean)
Auto Genernate Javabean

5. Run the following java code

		
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.BeeFactory;
import org.teasoft.honey.osql.core.Logger;

/**
 * @author Kingstar
 * @since 1.0
 */
public class SuidExamEN {

	public static void main(String[] args) {

		try {
			Suid suid = BeeFactory.getHoneyFactory().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.	

More example/test case

Rapid application development:

Let Java more quicker programming than php and Rails.

Faster development of new combinations of Java Web:
Bee+Spring+SpringMVC

Faster development of new combinations of Spring Cloud microservices:
Bee + Spring Boot

...

Contact & Welcome:

Author's email: [email protected]

If you have any problem on bee, please let me know kindly! Thank you, so much!

ORM QQ Group: 992650213 WeChat:AiTeaSoft

At the same time, welcome you to join Bee team create a better future.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].