# bee **Repository Path**: ycbd/bee ## Basic Information - **Project Name**: bee - **Description**: Bee是一个具有人工智能(AI)特性,开发速度快、简单、自动高效的Java ORM框架!它的编码复杂度是O(1),不管操作多少张表,都可以不需要写额外的dao代码。Bee同时支持面向对象和自定义SQL两种方式,简单场景和复杂场景都可以应用。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://gitee.com/automvc/bee - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 136 - **Created**: 2020-03-08 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Bee ========= **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 **Honey** see: https://github.com/automvc/honey ## [中文介绍](../../../bee/blob/master/README_CN.md) [点击链接可查看中文介绍](../../../bee/blob/master/README_CN.md) ## Requirement jdk1.7+ ## Feature & Function: **V1.0** Single entity(table) Suid (select,update,insert,delete) object-oriented operation. Automatically generate the Javabean via DB table or view(MySQL,MariaDB). 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.1** Json format Result support. Procedure(Query type) support. **V1.2** Customer sql support #{para} placeholder,eg:name=#{name}; like keyword support:#{%para%},#{%para},#{para%} **V1.3** Add: chain programming(select&update) **V1.4** Add: selectById,deleteById Add: public List select(T entity,String selectFields,int start,int size) Enhance: selectJson add config:ignoreNull;date,time,timestamp Wit hMillisecond format Enhance: List select(String sql), add config:nullToEmptyString Enhance ResultSet Cache mechanism Cache support: never,forever,forever and modify Syn,resultSet's size control. Add: SysValue annotation **V1.5** 1.add NameTranslate interface and default implement class,support customize translation rule of DB and Java naming. 2.support jdbcTypeToFieldType-{DbName}.properties,define DB's column type map java type. 3.enhance Oracle's type translation;other DB can define the column type and java type. mapping in file: jdbcTypeToFieldType-{DbName}.properties. 4.add special entity and table name mapping support. Optimize table name to entity name. 5.add BeeIllegalEntityException for check illegal Entity. 6.add create file util. 7.enhance paging function,and support customize extend interface. 8.fix ORA-00911 bug,it will cause when operate oracle DB with JDBC. 9.override the op method for default equal(in UpdateImpl and SelectImpl). 10.add override OperationType in enum Op. **V1.6** 1.Suid add complicate select oriented object. Suid add method:public List select(T entity,Condition condition); support complicate select;support to use between、like、in、>、>=、<、<=、group by、having、order by、paging at same time. 2.SuidRich add complicate select oriented object. SuidRich add new method: select(T entity, IncludeType includeType, Condition condition) selectJson(T entity, IncludeType includeType, Condition condition) 3.SuidRich add new method: updateBy(T entity,String whereFieldList) updateBy(T entity,String whereFieldList,IncludeType includeType) 4.add SqlNullException in PreparedSqlLib. V1.6.1 1.PreparedSql add start & size paging parameters in relative methods. 2.add Deprecated to modify method in PreparedSql. 3.update getFieldSet method's return type with Java generics. 4.fix bug.ConditionImpl's fieldSet need record the field in between method. **V1.7** more tables select oriented object support. 1.support one to one,one to many,many to one,many to many. 2.support join(inner join), left join,right join, no join. 3.The select operations of single table and more tables do not affect each other. **V1.7.1** gen javabean support create comment. support getColumnNames,getFieldNames method in GenBean. fix the bug for the define sql no placeholder. fix the bug for page in PreparedSqlLib. enhance the exception when the sql string is null(CustomSql). fix bug about cache. fix bug in SelectImpl. fix bug for inner join condition style. add FileCreator interface. **V1.7.2** support set the default naming translate type by config. enhance function of BeeFactory. adjust the format of SQL log. support set the date format by config. [move test/example to new project bee-exam](../../../bee-exam). add class FileLogger for write the log in file. support control print log level or not by config. enhance test case/example. Quick Start: ========= ## 1. Add Bee #### 1.1 if it is a maven project,add the following dependency ```xml org.teasoft bee 1.7.1 org.teasoft honey 1.7.1 ``` #### 1.2 Of course, can download the jar file directly ## 2. Create the database and the table Create one database,default name is bee. Create the table and init the data by run the bee.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.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. Run the following java code ```java import java.math.BigDecimal; import java.util.List; import org.teasoft.bee.osql.Suid; import org.teasoft.honey.osql.core.BeeFactory; import org.teasoft.honey.osql.example.entity.Orders; /** * @author Kingstar * @since 1.0 */ public class OsqlExamEN { public static void main(String[] args) { Suid suid=BeeFactory.getHoneyFactory().getSuid(); Orders orders1=new Orders(); orders1.setId(100001L); orders1.setName("Bee--ORM Framework"); List list1 =suid.select(orders1); //select for (int i = 0; i < list1.size(); i++) { System.out.println(list1.get(i).toString()); } orders1.setName("Bee--ORM Framework"); int updateNum=suid.update(orders1); //update System.out.println("update record:"+updateNum); Orders orders2=new Orders(); orders2.setUserid("client01"); orders2.setName("ORM book"); orders2.setTotal(new BigDecimal(91)); orders2.setRemark(""); //empty String test int insertNum=suid.insert(orders2); //insert System.out.println("insert record:"+insertNum); int deleteNum=suid.delete(orders2); //delete System.out.println("delete record:"+deleteNum); List list2 =suid.select(orders1); //select confirm the data for (int i = 0; i < list2.size(); i++) { System.out.println(list2.get(i).toString()); } } // notice: this is just a simple sample. Bee suport transaction,paging,complicate select,slect json,and so on. } ``` Rapid application development: ========= **Let Java more quicker programming than php and Rails.** **Faster development of new combinations of Java Web:** [Bee+Spring+SpringMVC](../../../../aiteasoft/bee-spring-springmvc) **Faster development of new combinations of Spring Cloud microservices:** [Bee + Spring Boot](../../../bee-springboot) ... Contact & Welcome: ========= #### Author's email: honeysoft@126.com #### If you have any problem on bee, please let me know kindly! Thank you, so much! #### At the same time, welcome you to join Bee team create a better future.