Hello, everyone, I am for the majority of programmers brothers worry broken heart xiaobian, every day to recommend a small tool/source, full of your favorites, every day to share a small skill, let you easily save development efficiency, do not work overtime do not stay up late do not lose hair, is my goal!

Bee is a simple, easy-to-use, powerful, fast development, less coding Java ORM framework.

Bee development is fast, simple, automatic and efficient with artificial intelligence (AI) characteristics! Its coding complexity is O(1), and no matter how many tables you manipulate, you don’t need to write additional Dao code. Bee supports both object-oriented and custom SQL, which can be applied in both simple and complex scenarios.

Bee complex query supports object, paging query performance is higher, level 1 cache can support personalized optimization; It has distributed characteristics. Advanced requirements, but also easy to customize SQL statements.

If Mybatis does not repeat the wheel after Hibernate, Bee will not repeat the wheel after Hibernate and Mybatis!

Functional features

  • 1. Simple interface, easy to use. Suid interface corresponding SQL language select, update, insert and delete operations provides four methods with the same name.
  • 2. With Bee, you can directly call Bee API to complete DB operations without writing DAO code.
  • 3. Convention is better than configuration: Javabeans have no annotations and do not require XML mapping files, just pure Javabeans, and even get and set methods can not be used.
  • 4. Intelligent automatic filter null and empty string, no longer write judge non-empty code.
  • 5. Dynamic or arbitrary combination of query conditions. Dao interfaces do not need to be prepared in advance, and interfaces do not need to be modified or added if new query requirements exist.
  • 6. Support native SQL sorting, native statement paging (do not need to find out all data).
  • 7. Directly return the query result in Json format. Chain programming.
  • 8. Support transactions, for UPDATE, support batch operations, support native SQL(custom SQL statements), support stored procedures.
  • 9. You can query only some fields.
  • 10. Support object-oriented complex query, multi-table query (no N +1 problem; Support: one-to-one, one-to-many, many-to-one, many-to-many).
  • 11. Level 1 cache, simple concept, powerful function; Level 1 caches can also be fine-tuned as fine-grained as JVMS; Intelligent cache, support to update the configuration table, no need to restart.
  • 12. By default, multiple implementations are provided for mapping table names to entity names, field names to attribute names, and custom mapping rule extensions are supported.
  • 13. A variety of DB support easily extend (MySQL and MariaDB, Oracle, H2, SQLite, PostgreSQL, directly available).
  • 14. No third-party plug-in dependency; It can be used with zero configuration.
  • 15. Provide automatic generation tools for Javabean corresponding to tables, and Javaweb back-end codes are automatically generated according to templates; Can print non-placeholder executable SQL for easy debugging.
  • 16. Support read and write separation of one master and many slave, only branch library and other multi-data source mode.
  • 17. Generate continuous monotonically increasing (within a workerID), globally unique numeric ID in distributed environment; Provides natural and simple distributed primary key generation.
  • 18. Support sub-table with library, dynamic table name mapping.
  • 19. Good performance: close to JDBC speed; Small file: Bee V1.8 JAR is only 217K.

The sample application

import java.math.BigDecimal;
import java.util.List;
import org.teasoft.bee.osql.Suid;
import org.teasoft.honey.osql.core.BeeFactory;

/ * * check, change, add, delete Suid (select, update, insert, delete) instance * /
public class SuidExam {
	
	public static void main(String[] args) {

		Suid suid=BeeFactory.getHoneyFactory().getSuid();
		
		// need to generate the corresponding Javabean
		Orders orders1=new Orders();
		orders1.setId(100001L);
		orders1.setName("Bee(ORM Framework)");
		
		//1:select a query instance
		// Null and empty strings are not handled by default. Instead of writing a bunch of judgments; All other fields with values are automatically filtered
		List<Orders> list1 =suid.select(orders1);  //select
		for (int i = 0; i < list1.size(); i++) {
			System.out.println(list1.get(i).toString());
		}
		
		//2:update the instance
		orders1.setName("Bee--ORM Framework");
		// Only the fields that need to be updated are updated by default. By default, only the ID field is used for filtering conditions. Other requirements can be used in SuidRich.
		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  		
		// Null and empty strings are not handled by default. Instead of writing a bunch of judgments; All other fields with values are automatically inserted into the database.
		// Easy to combine with DB interpolation, such as id automatic growth, by DB insert; Createtime is inserted by DB by default
		System.out.println("insert record:"+insertNum);
		
		//4:delete Deletes the instance
		// Null and empty strings are not handled by default. Instead of writing a bunch of judgments; All other fields with values are automatically filtered
		//int deleteNum=suid.delete(orders2); //delete
		//System.out.println("delete record:"+deleteNum);}}Copy the code

At the end

This issue is to share here, I am xiaobian South wind blowing, focus on sharing interesting, novel, practical open source projects and developer tools, learning resources! I hope to learn and communicate with you together. Welcome to follow my official account ** [Github navigation station] **.