# honey **Repository Path**: distributed-orm/honey ## Basic Information - **Project Name**: honey - **Description**: Bee 是一个十分钟就可以学会用的ORM框架! 具有人工智能(AI)特性,开发速度快、简单、自动高效( Tea: Timesaving/Tasteful, Easy, Automatic) 的ORM框架。 Honey 是Bee的实现. - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: https://gitee.com/automvc/honey - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 13 - **Created**: 2020-06-21 - **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 whereFields) updateBy(T entity,String whereFields,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. support generate the file according to template. add method delete(T entity, Condition condition) in Suid. support setting not allowed delete whole records in one table while Object Oriented way. SuidRich add 2 methods: updateBy(T entity,String whereFields,Condition condition) update(T entity,String updateFields,Condition condition) add nocache config support. add method setAdd,setMultiply in Condition for set value in SQL update. **V1.7.3** 1.Oracle DATE column mapping to Timestamp,fix the problem:miss the hour,minute,second in Oracle DATE column. 2.fix cache bug:genkey;clear cache for batch insert. 3.Generate global unique id number in distributed environment. 4.Generate Serial Unique id number in one workid of distributed environment. update id gen:SerialUniqueId,OneTimeSnowflakeId. 5.fixed bug:parse the json has extra comma. 6.add 2 methods in Condition: public Condition setAdd(String field, String fieldName) public Condition setMultiply(String field, String fieldName) 7.Support show type of data in sql and show ExecutableSql: bee.osql.showSQL.showType=false bee.osql.showSQL.showExecutableSql=false Quick Start: ========= ## 1. Add Bee #### 1.1 if it is a maven project,add the following dependency ```xml org.teasoft bee 1.7.2 org.teasoft honey 1.7.2 ``` #### 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](../../../bee-exam/blob/master/src/main/resources/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. 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("Bee(ORM Framework)"); 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.