diff --git a/fluent-sql-core/pom.xml b/fluent-sql-core/pom.xml index a8d0a19..1de98f5 100644 --- a/fluent-sql-core/pom.xml +++ b/fluent-sql-core/pom.xml @@ -33,6 +33,11 @@ javax.persistence persistence-api + + io.projectreactor + reactor-core + true + org.slf4j slf4j-api 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 32669f3..01a9b7e 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 @@ -5,6 +5,7 @@ import group.flyfish.fluent.chain.common.HandleSqlChain; 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.select.PieceSqlChain; import group.flyfish.fluent.chain.update.AfterSetSqlChain; import group.flyfish.fluent.debug.FluentSqlDebugger; import group.flyfish.fluent.entity.SQLEntity; @@ -39,6 +40,7 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre // 共享的操作 private static FluentSQLOperations SHARED_OPERATIONS; + // 参数map,有序 private final List parameters = new ArrayList<>(); @@ -46,7 +48,7 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre private Class primaryClass; // sql实体提供者 - private final Supplier entity = wrap(this::entity); + private final Supplier entity = wrap(this::toEntity); /** * 绑定实现类 @@ -163,6 +165,7 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre * @param query 条件 * @return 结果 */ + @Override public AfterWhereSqlChain matching(Query query) { if (withoutParameter(query)) return this; return concat("WHERE").concat(query); @@ -195,7 +198,9 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre * @param clazz 结果类 * @param 泛型 */ + @Override public T one(Class clazz) { + limit(1); return SHARED_OPERATIONS.selectOne(entity.get(), clazz); } @@ -222,7 +227,17 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre */ @Override public int execute() { - return SHARED_OPERATIONS.execute(entity()); + return SHARED_OPERATIONS.execute(toEntity()); + } + + /** + * 获取实体,做下一步的事情 + * + * @return 结果 + */ + @Override + public SQLEntity toEntity() { + return SQLEntity.of(wrap(this::sql), wrap(this::parsedParameters)); } /** @@ -265,13 +280,13 @@ final class SQLImpl extends ConcatSegment implements SQLOperations, Pre return false; } - /** - * 将本实体转换为sql实体 - * - * @return 转换结果 - */ - private SQLEntity entity() { - return SQLEntity.of(wrap(this::sql), wrap(this::parsedParameters)); + @Override + public PieceSqlChain limit(int count) { + return concat("LIMIT").concat(String.valueOf(count)); } + @Override + public PieceSqlChain offset(int rows) { + return concat("OFFSET").concat(String.valueOf(rows)); + } } diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/common/ExecutableSql.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/common/ExecutableSql.java index fbedf9c..9fd8917 100644 --- a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/common/ExecutableSql.java +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/common/ExecutableSql.java @@ -1,5 +1,7 @@ package group.flyfish.fluent.chain.common; +import group.flyfish.fluent.entity.SQLEntity; + /** * 可执行的sql * @@ -13,4 +15,11 @@ public interface ExecutableSql { * @return 更新条数 */ int execute(); + + /** + * 转换为SQL实体 + * + * @return 结果 + */ + SQLEntity toEntity(); } diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/AfterOrderSqlChain.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/AfterOrderSqlChain.java index c3d94d0..726b470 100644 --- a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/AfterOrderSqlChain.java +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/AfterOrderSqlChain.java @@ -1,47 +1,10 @@ package group.flyfish.fluent.chain.select; -import group.flyfish.fluent.chain.common.ExecutableSql; - -import java.util.List; - /** * order做完后支持的操作 * * @author wangyu */ -public interface AfterOrderSqlChain extends ExecutableSql { +public interface AfterOrderSqlChain extends PieceSqlChain { - /** - * 执行并获取结果 - * - * @param 泛型 - * @return 单一结果值 - */ - T one(); - - /** - * 执行并获取结果 - * - * @param clazz 结果类 - * @param 泛型 - * @return 单一结果值 - */ - T one(Class clazz); - - /** - * 执行并获取多条结果,以主表class为结果 - * - * @param 结果泛型 - * @return 结果列表 - */ - List list(); - - /** - * 执行并获取多条结果 - * - * @param clazz 结果类 - * @param 结果泛型 - * @return 结果列表 - */ - List list(Class clazz); } diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/FetchSqlChain.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/FetchSqlChain.java new file mode 100644 index 0000000..2ae8212 --- /dev/null +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/FetchSqlChain.java @@ -0,0 +1,42 @@ +package group.flyfish.fluent.chain.select; + +import group.flyfish.fluent.chain.common.ExecutableSql; + +import java.util.List; + +public interface FetchSqlChain extends ExecutableSql { + + /** + * 执行并获取结果 + * + * @param 泛型 + * @return 单一结果值 + */ + T one(); + + /** + * 执行并获取结果 + * + * @param clazz 结果类 + * @param 泛型 + * @return 单一结果值 + */ + T one(Class clazz); + + /** + * 执行并获取多条结果,以主表class为结果 + * + * @param 结果泛型 + * @return 结果列表 + */ + List list(); + + /** + * 执行并获取多条结果 + * + * @param clazz 结果类 + * @param 结果泛型 + * @return 结果列表 + */ + List list(Class clazz); +} diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/PieceSqlChain.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/PieceSqlChain.java new file mode 100644 index 0000000..2efce7b --- /dev/null +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/chain/select/PieceSqlChain.java @@ -0,0 +1,25 @@ +package group.flyfish.fluent.chain.select; + +/** + * 支持分片的sql链 + * + * @author wangyu + */ +public interface PieceSqlChain extends FetchSqlChain { + + /** + * 限制返回条数 + * + * @param count 条数 + * @return 结果 + */ + PieceSqlChain limit(int count); + + /** + * 跳过多少行 + * + * @param rows 行数 + * @return 结果 + */ + PieceSqlChain offset(int rows); +} diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/entity/DataPage.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/entity/DataPage.java new file mode 100644 index 0000000..4bff244 --- /dev/null +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/entity/DataPage.java @@ -0,0 +1,22 @@ +package group.flyfish.fluent.entity; + +import lombok.Data; + +import java.util.List; + +/** + * 数据分页 + * + * @author wangyu + */ +@Data +public class DataPage { + + private List list; + + private long total; + + private int size = 10; + + private int page = 1; +} diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/FluentSQLOperations.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/FluentSQLOperations.java index 3401be0..ec971b3 100644 --- a/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/FluentSQLOperations.java +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/FluentSQLOperations.java @@ -1,5 +1,6 @@ package group.flyfish.fluent.operations; +import group.flyfish.fluent.entity.DataPage; import group.flyfish.fluent.entity.SQLEntity; import org.springframework.lang.Nullable; @@ -35,6 +36,16 @@ public interface FluentSQLOperations { */ List select(SQLEntity entity, Class clazz); + /** + * 分页查询 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @param 目标泛型 + * @return 返回的分页对象 + */ + DataPage selectPage(SQLEntity entity, Class clazz); + /** * 直接执行sql,根据update count返回更新行数,如果是查询,永远返回0 * diff --git a/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/ReactiveFluentSQLOperations.java b/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/ReactiveFluentSQLOperations.java new file mode 100644 index 0000000..bf03931 --- /dev/null +++ b/fluent-sql-core/src/main/java/group/flyfish/fluent/operations/ReactiveFluentSQLOperations.java @@ -0,0 +1,56 @@ +package group.flyfish.fluent.operations; + +import group.flyfish.fluent.entity.DataPage; +import group.flyfish.fluent.entity.SQLEntity; +import org.springframework.lang.Nullable; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * sql query操作 + * + * @author wangyu + */ +public interface ReactiveFluentSQLOperations { + + /** + * 执行一条sql,并且序列化为对象 + * 注意,如果查询不止一条,该方法仅返回第一条数据 + * 如果没有结果,将返回null + * + * @param entity sql实体 + * @param clazz 目标类型 + * @param 目标泛型 + * @return 查询结果 + */ + @Nullable + Mono selectOne(SQLEntity entity, Class clazz); + + /** + * 执行一条sql,并且查询出所有行 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @param 目标泛型 + * @return 返回的列表 + */ + Flux select(SQLEntity entity, Class clazz); + + /** + * 分页查询 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @param 目标泛型 + * @return 返回的分页对象 + */ + Mono> selectPage(SQLEntity entity, Class clazz); + + /** + * 直接执行sql,根据update count返回更新行数,如果是查询,永远返回0 + * + * @param entity sql实体 + * @return 更新行数 + */ + Mono execute(SQLEntity entity); +} diff --git a/fluent-sql-spring-boot-starter/pom.xml b/fluent-sql-spring-boot-starter/pom.xml index 6b9936d..48a8d80 100644 --- a/fluent-sql-spring-boot-starter/pom.xml +++ b/fluent-sql-spring-boot-starter/pom.xml @@ -24,7 +24,17 @@ group.flyfish.framework - fluent-sql-spring-jdbc + fluent-sql-spring + + + org.springframework + spring-r2dbc + true + + + org.springframework + spring-jdbc + true diff --git a/fluent-sql-spring-boot-starter/src/main/java/group/flyfish/fluent/autoconfigure/FluentSqlAutoConfiguration.java b/fluent-sql-spring-boot-starter/src/main/java/group/flyfish/fluent/autoconfigure/FluentSqlAutoConfiguration.java index 23baa0e..cab77cf 100644 --- a/fluent-sql-spring-boot-starter/src/main/java/group/flyfish/fluent/autoconfigure/FluentSqlAutoConfiguration.java +++ b/fluent-sql-spring-boot-starter/src/main/java/group/flyfish/fluent/autoconfigure/FluentSqlAutoConfiguration.java @@ -1,13 +1,20 @@ package group.flyfish.fluent.autoconfigure; +import group.flyfish.fluent.autoconfigure.FluentSqlAutoConfiguration.JdbcFluentSqlAutoConfigure; +import group.flyfish.fluent.autoconfigure.FluentSqlAutoConfiguration.R2dbcFluentSqlAutoConfigure; import group.flyfish.fluent.operations.FluentSQLOperations; import group.flyfish.fluent.operations.JdbcTemplateFluentSQLOperations; +import group.flyfish.fluent.operations.R2dbcFluentSQLOperations; +import group.flyfish.fluent.operations.ReactiveFluentSQLOperations; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Import; import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.r2dbc.core.DatabaseClient; import javax.sql.DataSource; @@ -17,17 +24,38 @@ import javax.sql.DataSource; * @author wangyu */ @AutoConfigureAfter(DataSourceAutoConfiguration.class) +@Import({R2dbcFluentSqlAutoConfigure.class, JdbcFluentSqlAutoConfigure.class}) public class FluentSqlAutoConfiguration { - /** - * 动态注入初始化的bean,完成注入配置 - * - * @param dataSource 从spring datasource注入 - */ - @Bean - @ConditionalOnMissingBean(FluentSQLOperations.class) - @ConditionalOnBean(DataSource.class) - public FluentSQLOperations fluentSQLOperations(DataSource dataSource) { - return new JdbcTemplateFluentSQLOperations(new JdbcTemplate(dataSource)); + @ConditionalOnClass(DatabaseClient.class) + static class R2dbcFluentSqlAutoConfigure { + + /** + * 动态注入初始化的bean,完成注入配置 + * + * @param databaseClient 从spring r2dbc注入 + */ + @Bean + @ConditionalOnMissingBean(ReactiveFluentSQLOperations.class) + @ConditionalOnBean(DatabaseClient.class) + public ReactiveFluentSQLOperations fluentSQLOperations(DatabaseClient databaseClient) { + return new R2dbcFluentSQLOperations(databaseClient); + } + } + + @ConditionalOnClass(DataSource.class) + static class JdbcFluentSqlAutoConfigure { + + /** + * 动态注入初始化的bean,完成注入配置 + * + * @param dataSource 从spring datasource注入 + */ + @Bean + @ConditionalOnMissingBean(FluentSQLOperations.class) + @ConditionalOnBean(DataSource.class) + public FluentSQLOperations fluentSQLOperations(DataSource dataSource) { + return new JdbcTemplateFluentSQLOperations(new JdbcTemplate(dataSource)); + } } } diff --git a/fluent-sql-spring-jdbc/pom.xml b/fluent-sql-spring/pom.xml similarity index 89% rename from fluent-sql-spring-jdbc/pom.xml rename to fluent-sql-spring/pom.xml index 7e9c538..1e641f6 100644 --- a/fluent-sql-spring-jdbc/pom.xml +++ b/fluent-sql-spring/pom.xml @@ -9,7 +9,7 @@ 4.0.0 - fluent-sql-spring-jdbc + fluent-sql-spring 8 @@ -24,6 +24,12 @@ org.springframework spring-jdbc + true + + + org.springframework + spring-r2dbc + true junit diff --git a/fluent-sql-spring-jdbc/src/main/java/group/flyfish/fluent/mapping/SQLMappedRowMapper.java b/fluent-sql-spring/src/main/java/group/flyfish/fluent/mapping/SQLMappedRowMapper.java similarity index 100% rename from fluent-sql-spring-jdbc/src/main/java/group/flyfish/fluent/mapping/SQLMappedRowMapper.java rename to fluent-sql-spring/src/main/java/group/flyfish/fluent/mapping/SQLMappedRowMapper.java diff --git a/fluent-sql-spring-jdbc/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java b/fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java similarity index 87% rename from fluent-sql-spring-jdbc/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java rename to fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java index 94d4e12..ec22771 100644 --- a/fluent-sql-spring-jdbc/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java +++ b/fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/JdbcTemplateFluentSQLOperations.java @@ -1,6 +1,7 @@ package group.flyfish.fluent.operations; import group.flyfish.fluent.chain.SQL; +import group.flyfish.fluent.entity.DataPage; import group.flyfish.fluent.entity.SQLEntity; import group.flyfish.fluent.mapping.SQLMappedRowMapper; import org.springframework.dao.EmptyResultDataAccessException; @@ -41,7 +42,7 @@ public class JdbcTemplateFluentSQLOperations implements FluentSQLOperations { @SuppressWarnings("all") public T selectOne(SQLEntity entity, Class clazz) { try { - String sql = entity.getSql().concat(" limit 1"); + String sql = entity.getSql(); if (ClassUtils.isPrimitiveOrWrapper(clazz)) { return jdbcOperations.queryForObject(sql, clazz, entity.getParameters()); } @@ -67,6 +68,18 @@ public class JdbcTemplateFluentSQLOperations implements FluentSQLOperations { return jdbcOperations.query(sql, new SQLMappedRowMapper<>(clazz), entity.getParameters()); } + /** + * 分页查询 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @return 返回的分页对象 + */ + @Override + public DataPage selectPage(SQLEntity entity, Class clazz) { + return null; + } + /** * 直接执行sql,根据update count返回更新行数,如果是查询,永远返回0 * diff --git a/fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/R2dbcFluentSQLOperations.java b/fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/R2dbcFluentSQLOperations.java new file mode 100644 index 0000000..96ee6b7 --- /dev/null +++ b/fluent-sql-spring/src/main/java/group/flyfish/fluent/operations/R2dbcFluentSQLOperations.java @@ -0,0 +1,63 @@ +package group.flyfish.fluent.operations; + +import group.flyfish.fluent.entity.DataPage; +import group.flyfish.fluent.entity.SQLEntity; +import lombok.RequiredArgsConstructor; +import org.springframework.r2dbc.core.DatabaseClient; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +@RequiredArgsConstructor +public class R2dbcFluentSQLOperations implements ReactiveFluentSQLOperations { + + private final DatabaseClient databaseClient; + + /** + * 执行一条sql,并且序列化为对象 + * 注意,如果查询不止一条,该方法仅返回第一条数据 + * 如果没有结果,将返回null + * + * @param entity sql实体 + * @param clazz 目标类型 + * @return 查询结果 + */ + @Override + public Mono selectOne(SQLEntity entity, Class clazz) { + return null; + } + + /** + * 执行一条sql,并且查询出所有行 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @return 返回的列表 + */ + @Override + public Flux select(SQLEntity entity, Class clazz) { + return null; + } + + /** + * 分页查询 + * + * @param entity sql实体 + * @param clazz 目标类型 + * @return 返回的分页对象 + */ + @Override + public Mono> selectPage(SQLEntity entity, Class clazz) { + return null; + } + + /** + * 直接执行sql,根据update count返回更新行数,如果是查询,永远返回0 + * + * @param entity sql实体 + * @return 更新行数 + */ + @Override + public Mono execute(SQLEntity entity) { + return null; + } +} diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/FluentJdbcTest.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/FluentJdbcTest.java similarity index 98% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/FluentJdbcTest.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/FluentJdbcTest.java index dd32b55..9c1f805 100644 --- a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/FluentJdbcTest.java +++ b/fluent-sql-spring/src/test/java/group/flyfish/framework/FluentJdbcTest.java @@ -35,7 +35,7 @@ public class FluentJdbcTest { public void testSql() throws SQLException, JsonProcessingException { DataSource dataSource = new SimpleDriverDataSource( new Driver(), - "jdbc:mysql://127.0.0.1:3306/epi_project?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai", + "jdbc:mysql://127.0.0.1:3306/epi_project?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true", "root", "Unicom#2018" // "oI3WtMO8h%mSYARp" ); diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/TestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/TestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/TestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/TestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/AbstractTestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/cases/AbstractTestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/AbstractTestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/cases/AbstractTestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/FluentSqlTestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/cases/FluentSqlTestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/FluentSqlTestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/cases/FluentSqlTestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/JdbcTestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/cases/JdbcTestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/JdbcTestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/cases/JdbcTestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/MybatisTestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/cases/MybatisTestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/MybatisTestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/cases/MybatisTestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/SingleTableTestCase.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/cases/SingleTableTestCase.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/cases/SingleTableTestCase.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/cases/SingleTableTestCase.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/Po.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/Po.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/Po.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/Po.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/Property.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/Property.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/Property.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/Property.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasOrder.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasOrder.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasOrder.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasOrder.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasPlan.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasPlan.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasPlan.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasPlan.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasQuota.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasQuota.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasQuota.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasQuota.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasTenant.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasTenant.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/entity/SaasTenant.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/entity/SaasTenant.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.xml b/fluent-sql-spring/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.xml similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.xml rename to fluent-sql-spring/src/test/java/group/flyfish/framework/mapper/TenantContextMapper.xml diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/utils/LogUtils.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/utils/LogUtils.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/utils/LogUtils.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/utils/LogUtils.java diff --git a/fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/vo/TenantContext.java b/fluent-sql-spring/src/test/java/group/flyfish/framework/vo/TenantContext.java similarity index 100% rename from fluent-sql-spring-jdbc/src/test/java/group/flyfish/framework/vo/TenantContext.java rename to fluent-sql-spring/src/test/java/group/flyfish/framework/vo/TenantContext.java diff --git a/pom.xml b/pom.xml index 3f0a5ba..fcd053b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ fluent-sql-core - fluent-sql-spring-jdbc + fluent-sql-spring fluent-sql-annotations fluent-sql-spring-boot-starter @@ -88,7 +88,7 @@ group.flyfish.framework - fluent-sql-spring-jdbc + fluent-sql-spring ${project.version} @@ -121,6 +121,11 @@ spring-context ${spring.version} + + org.springframework + spring-r2dbc + ${spring.version} + org.mybatis mybatis @@ -153,6 +158,11 @@ 8.0.29 test + + io.projectreactor + reactor-core + 3.6.7 +