From e390b81a9881e4d60ff580fa7975801519818fce Mon Sep 17 00:00:00 2001
From: wangyu <727842003@qq.com>
Date: Wed, 7 Sep 2022 13:17:25 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=91=E5=B8=830.0.1=E7=89=88?=
=?UTF-8?q?=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
fluent-sql-core/pom.xml | 4 +-
.../java/group/flyfish/fluent/chain/SQL.java | 6 +-
.../group/flyfish/fluent/chain/SQLImpl.java | 31 +++--
.../flyfish/fluent/entity/SQLEntity.java | 38 ++++++
.../operations/FluentSQLOperations.java | 45 +++++++
fluent-sql-jdbctemplate/pom.xml | 27 +++-
.../fluent/mapping/SQLMappedRowMapper.java | 0
.../JdbcTemplateFluentSQLOperations.java | 76 +++++++++++
.../flyfish/framework/FluentJdbcTest.java | 77 +++++++++++
.../group/flyfish/framework/entity/Po.java | 41 ++++++
.../flyfish/framework/entity/Property.java | 24 ++++
.../flyfish/framework/entity/SaasOrder.java | 79 ++++++++++++
.../flyfish/framework/entity/SaasPlan.java | 40 ++++++
.../flyfish/framework/entity/SaasQuota.java | 54 ++++++++
.../flyfish/framework/entity/SaasTenant.java | 120 ++++++++++++++++++
.../flyfish/framework/vo/TenantContext.java | 65 ++++++++++
pom.xml | 29 ++++-
18 files changed, 736 insertions(+), 22 deletions(-)
create mode 100644 fluent-sql-core/src/main/java/group/flyfish/fluent/entity/SQLEntity.java
create mode 100644 fluent-sql-core/src/main/java/group/flyfish/fluent/operations/FluentSQLOperations.java
rename {fluent-sql-core => fluent-sql-jdbctemplate}/src/main/java/group/flyfish/fluent/mapping/SQLMappedRowMapper.java (100%)
create mode 100644 fluent-sql-jdbctemplate/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/FluentJdbcTest.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/Po.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/Property.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/SaasOrder.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/SaasPlan.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/SaasQuota.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/entity/SaasTenant.java
create mode 100644 fluent-sql-jdbctemplate/src/test/java/group/flyfish/framework/vo/TenantContext.java
diff --git a/README.md b/README.md
index fee8ece..811689f 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
fluent-sql-core
group.flyfish.framework
- 1.0-SNAPSHOT
+ 0.0.1
```
diff --git a/fluent-sql-core/pom.xml b/fluent-sql-core/pom.xml
index 5e2d442..7d7dfb2 100644
--- a/fluent-sql-core/pom.xml
+++ b/fluent-sql-core/pom.xml
@@ -5,7 +5,7 @@
fluent-sql
group.flyfish.framework
- 1.0-SNAPSHOT
+ 0.0.1
4.0.0
@@ -23,7 +23,7 @@
org.springframework
- spring-jdbc
+ spring-beans
javax.persistence
diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQL.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQL.java
index f9afea0..6b3a95c 100644
--- a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQL.java
+++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQL.java
@@ -2,9 +2,9 @@ package group.flyfish.fluent.chain;
import group.flyfish.fluent.chain.common.PreSqlChain;
import group.flyfish.fluent.chain.select.SelectComposite;
+import group.flyfish.fluent.operations.FluentSQLOperations;
import group.flyfish.fluent.update.Update;
import group.flyfish.fluent.utils.sql.SFunction;
-import org.springframework.jdbc.core.JdbcOperations;
import static group.flyfish.fluent.utils.sql.SqlNameUtils.cast;
@@ -54,11 +54,11 @@ public interface SQL {
}
/**
- * 绑定数据源上下文,基于jdbc template
+ * 绑定数据源上下文,可自由切换实现
*
* @param operations jdbc操作
*/
- static void bind(JdbcOperations operations) {
+ static void bind(FluentSQLOperations operations) {
SQLImpl.bind(operations);
}
}
diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQLImpl.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQLImpl.java
index bb3ad7e..207f346 100644
--- a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQLImpl.java
+++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/SQLImpl.java
@@ -6,7 +6,8 @@ import group.flyfish.fluent.chain.common.PreSqlChain;
import group.flyfish.fluent.chain.select.AfterOrderSqlChain;
import group.flyfish.fluent.chain.select.AfterWhereSqlChain;
import group.flyfish.fluent.chain.update.AfterSetSqlChain;
-import group.flyfish.fluent.mapping.SQLMappedRowMapper;
+import group.flyfish.fluent.entity.SQLEntity;
+import group.flyfish.fluent.operations.FluentSQLOperations;
import group.flyfish.fluent.query.JoinCandidate;
import group.flyfish.fluent.query.Parameterized;
import group.flyfish.fluent.query.Query;
@@ -18,8 +19,6 @@ import group.flyfish.fluent.utils.sql.ConcatSegment;
import group.flyfish.fluent.utils.sql.EntityNameUtils;
import group.flyfish.fluent.utils.sql.SFunction;
import group.flyfish.fluent.utils.sql.SqlNameUtils;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.util.Assert;
import java.util.ArrayList;
@@ -35,7 +34,7 @@ import java.util.stream.Collectors;
final class SQLImpl extends ConcatSegment implements SQLOperations, PreSqlChain, HandleSqlChain, AfterJoinSqlChain, AfterSetSqlChain {
// 共享的操作
- private static JdbcOperations SHARED_OPERATIONS;
+ private static FluentSQLOperations SHARED_OPERATIONS;
// 参数map,有序
private final List