Giter Club home page Giter Club logo

bee's Introduction

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.Help you to focus more on the development of business logic.
Good Feature: AI, Timesaving/Tasteful, Easy, Automatic (AiTeaSoft Style)

Good News:

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

点击链接可查看中文介绍

Requirement

Bee jdk1.8+

Feature & Function:

Easy to use:

  • 1.Simple interface, convenient to use. The Suid interface provides four object-oriented methods corresponding to the SQL language's select, update, insert, and delete operations.
  • 2.By using Bee, you no longer need to write separate DAO code. You can directly call Bee's API to perform operations on the database.
  • 3.Convention-over-configuration: Javabean can no annotation, no xml.
  • 4.Intelligent automatic filtering of null and empty string properties in entities eliminates the need for writing code to check for non-null values.
  • 5.Easily implement partial field queries and native statement pagination.
  • 6.Supports returning query results in JSON format; supports chaining.
  • 7.Supports Sharding, both database and table Sharding; database-only Sharding; table-only Sharding; and read-write separation. This functionality is transparent to existing code and does not require additional coding.
  • 8.Easily extendable with multiple database support (MySQL, MariaDB, Oracle, H2, SQLite, PostgreSQL, SQL Server, Access, Kingbase, Dameng, etc.), and theoretically supports any database supported by JDBC. Additionally, supports Android and Harmony.
  • 9.Additional database pagination support for: MsAccess, Cubrid, HSQL, Derby, Firebird, etc.
  • 10.Multiple databases can be used simultaneously (e.g., MySQL, Oracle, SQL Server).

Automatic, powerful:

  • 11.Dynamic/arbitrary combination of query conditions without the need to prepare DAO interfaces in advance. New query requirements can be handled without modifying or adding interfaces.
  • 12.Supports transactions, using the same connection for multiple ORM operations, FOR UPDATE, batch processing, executing native SQL statements, and stored procedures.
  • 13.Supports object-oriented complex queries, multi-table queries (no N+1 problem), and supports one-to-one, one-to-many, many-to-one, and many-to-many relationships. The result structure can differ based on whether the sub-table uses List;multi-table association update, insert, and delete(2.1.8).
  • 14.MongoDB ORM and support for MongoDB Sharding.
  • 15.Supports register, interceptor, multi-tenancy, and custom TypeHandlers for handling ResultSet results in queries. SetParaTypeConvert converts PreparedStatement parameter types.
  • 16.Custom dynamic SQL tags, such as @in, @toIsNULL1, @toIsNULL2, , . Allows dynamic SQL, converting lists into statements like in (1,2,3) without requiring foreach loops. Batch insertion also does not require foreach.
  • 17.Complex query can be automatically parsed by the frontend and backend.
  • 18.L1 cache, simple in concept and powerful in function; L1 cache can also be fine tuned like the JVM; Support updatable long-term cache list and update configuration table without restart. Inherently resistant to cache penetration. L2 cache extension support; Redis L2 cache support.
  • 19.No third-party plugin dependencies; can be used with zero configuration.
  • 20.High performance: close to the speed of JDBC; small file size: Bee V1.17 is only 502k, V2.1 is only 827k.
    Assist function:
  • 21.Additional features: 21. Provides a naturally simple solution for generating distributed primary keys: generates globally unique, monotonically increasing (within a worker ID) numeric IDs in a distributed environment.
  • 22.Supports automatic generation of Javabean corresponding to tables(support Swagger), creating tables based on Javabean, and automatically generating backend Javaweb code based on templates. Can print executable SQL statements without placeholders for easy debugging. Supports generating SQL scripts in JSON format.
  • 23.Supports reading Excel files and importing data into the database; simple operations. Supports generating database tables from Excel configurations.
  • 24.Stream tool class StreamUtil;DateUtil date conversion, judge date format, calculate age.
  • 25.Rich annotation support: PrimaryKey, Column, Datetime, Createtime, Updatetime; JustFetch, ReplaceInto (MySQL), Dict, DictI18n,GridFs, etc.
  • 26.Use entity name _F (automatically generated) to reference entity field names, e.g., Users_F.name or in SuidRichExt interface using the format Users::getName.

Newest main Function

V2.4.0

  1. Chaing SQL programming supports placeholder precompilation to prevent injection attacks
  2. Do not cache if no table name is specified
  3. Add a default date sharding implementation for Calculate, and add a custom sharding implementation example
  4. Support ElasticSearch(7.x) ORM query
  5. PreparedSql support set table name for enhance relative cache
  6. MongoDB gen Javabean support gen comment

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
ConditionExt support Condition no need hard code the field name
10.add ChainSqlFactory

11.add select Result Assembler
12.MoreTable add methods:selectWithFun,count
13.MoreTable add method List<String[]> selectString(T entity, Condition condition)
14.enhance MoreTable update

15.support property style sharding config
16.MoreTable support selectJson
17.GenBean support java.time.LocalDateTime
18.fixed bug: GenConfig baseDir default value support Linux env
19.Suid support java.time.LocalDateTime type
20.TO_DATE for Oracle filter the record in SQL where part

V2.2(2024.1.1·LTS)

  1. Javabean entity supports inheritance (configure bee.osql.openEntityCanExtend=true).
  2. Enhanced the association between batch insert and transaction.
    2.2 Before version 2.2, calling batch insertion would commit on each batch, but in version 2.2, it is changed to only call once within a transaction. The content of the batch insertion method is no longer committed, but is controlled by the transaction.
  3. Fixed bugs:
    1. When Condition uses Op.in and the parameter is null, an exception is thrown.
    2. Context-related bug in sharding batch insert.
    3. Resolved context issues when only sharding databases.
    4. When sharding, the context of the main thread needs to be cleared.
    5. Bug with InheritableThreadLocal and parallelStream() being incompatible.In 2.2, when not in sharding mode, parallelStream() can be used, but it is not recommended to use parallelStream() when sharding.

V2.1(2023.05.20) main features:

  1. Move major commonly used interfaces such as Suid, SuidRich, MoreTable, PreparedSql, MapSuid, etc. to the org.teasoft.bee.osql.api package.
  2. Better support for MVC programming and Spring RestFul programming.
  3. Support configuration of multiple data sources in bee.properties (no need for XML or Java code configuration).
  4. GenBean supports Lombok annotations: @Setter, @Getter, @Data.
  5. Built-in json tool fastjson support, with the option to use a custom JSON tool.
  6. Generate all Java bean files for the entire database with a single line of code: new GenBean().genAllBeanFile();
  7. Bulk insert for broadcast table.
  8. Improved sharding functionality.
  9. Full support for MongoDB ORM.
    9.1. Support for insertion and querying of geospatial information in MongoDB (including sharded queries).
    9.2. Various operations on GridFs files, with support for annotations.
    9.3. Direct execution of native statements (MongodbRawSql).
    9.4. Logging of native statements for object-oriented operations in MongoDB.
    9.5. Support for MongoDB transactions.
    9.6. Support for creating and deleting indexes in MongoDB.
    9.7. MongoDB beans defined as pluggable components.
  10. Default support for pagination in more databases: MsAccess, Cubrid, HSQL, Derby, Firebird, etc.

click for: Function Detail

Bee Support Database list:

1.MySQL
2.Oracle
3.SQL Server
4.MariaDB
5.H2
6.SQLite
7.PostgreSQL
8.MS Access
9.Kingbase
10.DM
11.OceanBase
12.Cubrid,HSQL,Derby,Firebird
13.Other DB that support JDBC

NOSQL:
14.Mongodb
15.ElasticSearch
16.Cassandra

Mobile environment (database): 17.Android
18.Harmony

ORM Compare

Compare in JDBC

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

Bee application in App Compare

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

Quick Start:

1. Add Bee

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

       <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'

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

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

Use Bee in Android Environment

1.bee.properties

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

2.implement tables that need to be created and updated when app installation and upgrade

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);
		}
	}
}

3.Register YourAppCreateAndUpgrade and Android context to Bee

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"
       >

4.Java operation SQLite database is similar to JavaWeb

Suid suid=BF.getSuid();
List<Orders> list = suid.select(new Orders()); 

5.Bee application in App Compare

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

Bee Architecture

V2.1

Bee Common Interface

Rapid application development:

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

KmCoding

Rapid Application Code Generation Platform--AiTea Soft made in China!

Generate code automatically

...

App Demo:

HarmonyOS application Demo with ORM Bee:

Bee + HarmonyOS

Bee + Android

Other Document:

API-DOC

API-V1.17(Newest) SourceCode contain bee-1.17 CN & EN API,bee-1.17 CN SourceCode

wiki Document

CSDN: ORM Bee Document

Enterprise Edition:

In order to provide more and more powerful functions, Bee team cooperates with the enterprise to launch the Enterprise Version.

New Features

We hope to provide more easy-to-use Bee functions to further improve the efficiency of development!

  • 1.Reduce the difficulty of development financial computing projects, simplify financial digital calculation, etc
  • 2.@AutoSetString annotation ease of use improvement, easy to handle automatic filling functions such as CreateBy,UpdateBy
    Automatically insert values for tenants
  • 3.@Desensitize, change some sensitive information to mask characters
  • 4.@Dict specific field dictionary value conversion
  • 5.@DictI18n multilingual International Dictionary conversion, global unified setting, no need to set one by one, saving time and effort
  • 6.@MultiTenancy multi-tenant
  • 7.@Column when Javabean attribute is inconsistent with the table column name, define the mapping relationship (not recommended for new system, mainly for compatibility with old system)
  • 8.@Json Entity properties are Javabean and the JSON type column of DB table are converted automatically during parameter setting and query results
  • 9.Support the automatic generation of EDI XML electronic message
    Cheer ! Except for 1, 5, and 9, other items has been added to the V2.1 LTS version

Price

Enterprise users:
USD 199.00
Personal users:
USD 49.00

Expiration Dates

Permanent use after purchase,Get upgrades for free

Technical Support

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

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.

bee's People

Contributors

1540566561 avatar aiteasoft avatar autogood avatar automvc avatar javabeecn avatar qq202 avatar teasoft3 avatar wanglei199809 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bee's Issues

并发执行时,SQL拼接概率出现缺少空格/连接符导致SQL执行失败

Use:

          Condition condition = new ConditionImpl();
          String now = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss.SSS");
           condition.op("list_no", Op.in, CollUtil.join(listNos,","))
                    .op("start_valid_date", Op.le, now)
                    .op("end_valid_date", Op.ge, now)
                     ;
            bwListDetailDOS = req.stream().flatMap(r -> MySqlBeeProvider.select(BWListDetailDO
                    .builder().keyType(r.getDataTypeEm().getSource())
                    .keyValue(r.getDataValue())
                    .flag(BWListFlagEm.BLACK.getCode())
                    .status(BWListStatusEm.ENABLE.getCode())
                    .build(), condition).stream())
                    .collect(Collectors.toList());

SQL:
2021-09-09 15:49:11, INFO, org.teasoft.honey.osql.core.Logger, bwlist.schedule-1 [Bee] select SQL: select id,logic_key,key_type,key_value,flag,name,list_no,rule_no,version,list_hit_detail,source,status,start_valid_date,end_valid_date,create_at,create_user_id,create_user_name,datachange_lasttime,serial_no from bwlist_detail where key_type=? and key_value=? and flag=? and status=? and list_no in (?) and start_valid_date<=? and end_valid_date>=? [values]: 1,1304iqb8uyl0rgX720,1,0,BLCFT003,2021-09-09 15:49:11.950,2021-09-09 15:49:11.950
2021-09-09 15:49:11, INFO, org.teasoft.honey.osql.core.Logger, bwlist.schedule-2 [Bee] select SQL: select id,logic_key,key_type,key_value,flag,name,list_no,rule_no,version,list_hit_detail,source,status,start_valid_date,end_valid_date,create_at,create_user_id,create_user_name,datachange_lasttime,serial_no from bwlist_detail where key_type=? and key_value=? and flag=? ### and status=?list_no in (?) and start_valid_date<=? and end_valid_date>=? [values]: 1,1304iqb8uyl0rgX720,1,0,BLCFT005,2021-09-09 15:49:11.950,2021-09-09 15:49:11.950

Exception:
org.teasoft.bee.osql.BeeSQLException: Unknown column '0list_no' in 'where clause'
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '0list_no' in 'where clause'

Version:1.9.5

no Javabean operate the database

no Javabean, use map to set the entity information that needs to be transformed and operate the database(select/delete record).

BeeSql.selectJson 问题2

public static StringBuffer toJson(ResultSet rs) throws SQLException {
    StringBuffer json = new StringBuffer("");
    ResultSetMetaData rmeta = rs.getMetaData();
    int columnCount = rmeta.getColumnCount();

    while(rs.next()) {
        json.append(",{");

        for(int i = 1; i <= columnCount; ++i) {
            json.append("\"");
            json.append(rmeta.getColumnName(i));
            json.append("\":");
            if (rs.getString(i) != null && "String".equals(HoneyUtil.getFieldType(rmeta.getColumnTypeName(i)))) {
                json.append("\"");
                json.append(rs.getString(i).replace("\"", "\\\""));
                json.append("\"");
            } else {
                json.append(rs.getString(i));
            }

            if (i != columnCount) {
                json.append(",");
            }
        }

        json.append("}");
    }

    json.deleteCharAt(0);    // !!!  this will cause "java.lang.StringIndexOutOfBoundsException: String index out of range: 0"
    json.insert(0, "[");
    json.append("]");
    return json;
}

entity中非null且非空字符串将插入到数据库

null 过滤掉可以理解
空字符串感觉并不用过滤
比我 desc 字段表示自我介绍, null 就是从来没有设置过,『你好我叫xxx』 这个是有值状态, 空字符串表示 我把自我介绍删除了,但是我曾经设置过。
insertAndReturnId 把includeType 写死成-1了,会导致 null 和 空字符串都过滤掉了
不知道我理解的对不对,或者配合数据库有比较好的方案设计,请多指教

add PostgreSQL support

add PostgreSQL support(bee 's jar files just 217k)

add PostgreSQL 's column type and Javabean's field type mapping.
add jdbcTypeToFieldType-PostgreSQL.properties(optional).

添加PostgreSQL字段类型与Java属性类型的映射关系.

添加jdbcTypeToFieldType-PostgreSQL.properties文件

自动组装SQL方法未对特定数据库的特定关键字进行处理

在Oralce数据库中,使用双引号括起来特定的关键词就能在表的字段中使用该关键字例如“comment”,而在使用SQL查询时也必须使用双引号将特定关键字括起来。
如果没有括起来会报“缺少表达式”错误。
目前SUID的ObjToSQL方法生成comment时不会将关键词括起来,并且未给指定SQL方言的方法(或者从DataSource里面去扣关键词进行判断),会导致生成的SQL语句不正确。
期望BeeFactory方法增加选择特定Oracle方言的方法,并且允许扩展设定方言(传入一个替换语句的方法,例如Map<String,String>在Select表字段的时候碰到Map的KEY就用value代替)

Wanted : who is Using Bee

Who is Using Bee

First of all, thanks sincerely for constantly using and supporting Bee. We will try our best to keep Beebetter, and keep growing community.

The purpose of this issue

  • We’d like to listen to the community to make Bee better.
  • We want to attract more people to contribute to Bee.
  • We're willing to learn more Bee use scenarios in the field for better planning.

What we expect from you

Please submit a comment in this issue ,
include the following information:

  • your company, school or organization.
  • your city and country.
  • your contact info: blog, email, twitter (at least one,If it is not convenient to open your contact information, please send me separately).
  • What business scenario or function do you use Bee.
    You can refer to the following sample answer for the format:
* Orgnizatioin: Bee
* Location: Shenzhen, China
* Contact: [email protected]
* Scenario/Function: SpringCloud/Electronic Commerce.
* website: www.xxx.com
* logo

Action now,build Bee!

谁在使用 Bee

首先诚挚地感谢每一位持续关注并使用 Bee 的朋友。我们会持续投入,努力把 Bee 变得更好,把 Bee 社区和生态变得更加繁荣。

此 Issue 的目的

聆听社区的声音,让 Bee 变得更好
吸引更多的人参与贡献
更多的了解 Bee 的实际使用场景,以方便下一步的规划

我们期待您能在此提交一条评论, 评论内容包括:

  • 您所在公司、学校或组织
  • 您所在的城市、国家
  • 您的联系方式: 邮箱、QQ、微信 (至少一个,如果不方便公开您的联系信息,请单独发送给我)
  • 您将 Bee 用于哪些业务场景或功能
  • 官网url,logo

您可以参考下面的样例来提供您的信息:

* 组织:Bee
* 地点:**深圳
* 联系方式:[email protected]
* 业务场景/功能:SpringCloud、Dubbo、与数据库交互/电商网站管理数DB据 等
* 官网: www.xxx.com
* logo

开始行动,使用 Bee!

add H2 support, since bee 's jar files just 217k.

add H2 support, since bee 's jar files just 217k.

add H2 's column type and Javabean's field type mapping.
add jdbcTypeToFieldType-H2.properties(optional).

添加H2字段类型与Java属性类型的映射关系.

添加jdbcTypeToFieldType-H2.properties文件

moretable无法正常获得关联后结果

使用语言为kotlin
code:

data class Systems(
    var systemId: Int? = null, //系统ID
    var systemEnName: String? = null, //系统英文名称
    var systemCnName: String? = null, //系统中文名称
    @JoinTable(mainField="system_id", subField="system_id", joinType=JoinType.LEFT_JOIN)
    var hosts : Hosts? = null
) : Serializable

data class Hosts(
    var hostId: Int? = null, //主机ID
    var systemId: Int? = null, //主机对应系统ID
    var hostIp: String? = null, //主机IP地址
    var hostFileTransferPort: String? = null, //主机文件传输端口
    var hasClient: Int? = null, //是否部署了客户端
    var loginUser: String? = null, //连接用户
    var loginPassword: String? = null, //连接密码码
    var remark: String? = null, //备注
    var isOnline : Int ?= null //主机是否在线
) : Serializable

fun main() {
    val suid: Suid = BeeFactory.getHoneyFactory().suidRich
    println(suid.select(Systems(systemId = 1)))
    println(suid.select(Hosts(hostId = 1)))
    val moreTable = BeeFactory.getHoneyFactory().moreTable
    println(moreTable.select(Systems(systemId = 1)))
}

输出:
[Bee] LoggerFactory Use the Logger is : org.teasoft.honey.logging.SystemLogger
2021-08-04 15:08:38 [Bee] ========= get the dbName from HoneyConfig is :MOGDB
2021-08-04 15:08:38 [Bee] select SQL: select system_id,system_en_name,system_cn_name from systems where system_id=? [values]: 1
八月 04, 2021 3:08:38 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [cbc6c65e-d8b0-4921-96d0-bff6749186d4] Try to connect. IP: 110.128.5.111:5432
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [170.128.15.36:54563/110.128.5.111:5432] Connection is established. ID: cbc6c65e-d8b0-4921-96d0-bff6749186d4
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: Connect complete. ID: cbc6c65e-d8b0-4921-96d0-bff6749186d4
2021-08-04 15:08:39 [Bee] | <-- select rows: 1
[Systems(systemId=1, systemEnName=FST, systemCnName=第一测试系统, hosts=null)]
2021-08-04 15:08:39 [Bee] select SQL: select host_id,system_id,host_ip,host_file_transfer_port,has_client,login_user,login_password,remark,is_online from hosts where host_id=? [values]: 1
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [cab8dff1-fd14-41ee-bfb4-b61d62f7c88f] Try to connect. IP: 110.128.5.111:5432
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [170.128.15.36:54564/110.128.5.111:5432] Connection is established. ID: cab8dff1-fd14-41ee-bfb4-b61d62f7c88f
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: Connect complete. ID: cab8dff1-fd14-41ee-bfb4-b61d62f7c88f
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [b37353b8-57f1-4483-8ead-866a12fa9e9b] Try to connect. IP: 110.128.5.111:5432
2021-08-04 15:08:39 [Bee] | <-- select rows: 1
[Hosts(hostId=1, systemId=1, hostIp=110.128.5.111, hostFileTransferPort=3333, hasClient=1, loginUser=usera, loginPassword=apass, remark=应用服务器, isOnline=1)]
2021-08-04 15:08:39 [Bee] select SQL: select systems.system_id,systems.system_en_name,systems.system_cn_name,hosts.host_id,hosts.system_id,hosts.host_ip,hosts.host_file_transfer_port,hosts.has_client,hosts.login_user,hosts.login_password,hosts.remark,hosts.is_online from systems left join hosts on systems.system_id=hosts.system_id where systems.system_id=? [values]: 1
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: [170.128.15.36:54565/110.128.5.111:5432] Connection is established. ID: b37353b8-57f1-4483-8ead-866a12fa9e9b
八月 04, 2021 3:08:39 下午 org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl
信息: Connect complete. ID: b37353b8-57f1-4483-8ead-866a12fa9e9b
2021-08-04 15:08:39 [Bee] | <-- select rows: 1
[Systems(systemId=null, systemEnName=null, systemCnName=null, hosts=Hosts(hostId=null, systemId=null, hostIp=null, hostFileTransferPort=null, hasClient=null, loginUser=null, loginPassword=null, remark=null, isOnline=null))]

Process finished with exit code 0

可以看到我在查询单表的时候都可以成功,但是当使用moreTable进行查询的时候,却无法关联到,烦请指点,非常感谢~

请问一下作者大大有没有打算搞个github上可以编辑的代码文档类似于Vue的文档那样

如题,希望作者大大可以考虑搞个在github上可以上传的文档,我知道作者大大没时间弄复杂的文档,但是如果一个给别人用的框架没有文档别人会很难受,也不是每个人都有时间直接逆向源码(虽然看代码是最简单的方式,但是不给注释可以逼疯一票程序员),所以希望作者大致弄个可以在github或者gitbee上面编辑的文档就行了。
Bee ORM框架确实挺小挺好用的,尤其自动挡当作半自动挡开的时候(指数据源直接手动指定,剩下给Bee ORM搞),所以希望可以完善一下文档
可以使用docsify之内的去弄(官网:https://docsify.js.org/#/?id=docsify-4121)
CSDN上的教程:https://blog.csdn.net/Lonelyooacz/article/details/103439770

How to program for complicated update ?

How to program for complicated update ?
like:

"update tiny_id_info set max_id= ?," +
" update_time=now(), version=version+1" +
" where id=? and max_id=? and version=? and biz_type=?";

同库多表情况,API 风格咨询?

在一个DB中,随着数据量不断增长,需要将老的数据移到历史表中。
如,订单表orders,将5月,6月数据移到 orders_202005,orders_202006,结构与表orders一样。
如何用同一javabean,同时映射多个数据表?
API如何设计才能使用更加方便?

欢迎把你的好想法留下!

ConditionImpl使用in条件报错

当字段为int类型时,condition.op("id", Op.in,list); sql拼接报错,ERROR: operator does not exist: integer = character varying,

BeeSql.selectJson 问题

下面是selectJson执行sql时的返回结果, 日期缺少引号,无法转成json

[{"id":39,"user_id":"1303333333333333","master_id":null,"status":1,"is_online":1,"gmt_create":2019-07-25 11:23:24.0,"gmt_modify":2019-07-25 13:32:00.0,"gmt_active":2019-07-25 11:23:24.0,"source":"WEB","mac":null}]

add SQLite support, bee 's jar files just 217k.

Since bee 's jar files just 217k, it is agood choice for SQLite .

add SQLite 's column type and Javabean's field type mapping.
add jdbcTypeToFieldType-SQLite.properties(optional).

添加SQLite字段类型与Java属性类型的映射关系.

添加jdbcTypeToFieldType-SQLite.properties文件

support field1=field2 in where

eg: opWithField(field1,Op.eq,field2)-->field1=field2
public Condition opWithField(String field1, Op Op, String field2);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.