miemie 5 anni fa
parent
commit
6d24f622bf

+ 0 - 1
build.gradle

@@ -171,7 +171,6 @@ subprojects {
         dependsOn("cleanTest", "generatePomFileForMavenJavaPublication")
         useJUnitPlatform()
         exclude("**/generator/**")
-        exclude("**/postgres/**")
         exclude("**/mysql/**")
     }
 

+ 39 - 0
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/entity/FillTenantEnumVersion.java

@@ -0,0 +1,39 @@
+package com.baomidou.mybatisplus.test.mysql.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.test.mysql.enums.TestEnum;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author miemie
+ * @since 2019-11-22
+ */
+@Data
+@Accessors(chain = true)
+@TableName("ftev")
+public class FillTenantEnumVersion {
+
+    private Long id;
+    private Integer tInt;
+    @TableField //无意义
+    private String tStr;
+    @TableField(value = "c_time", fill = FieldFill.INSERT)
+    private LocalDateTime createTime;
+    @TableField(value = "u_time", fill = FieldFill.UPDATE)
+    private LocalDateTime updTime;
+    private TestEnum testEnum;
+
+    @Version
+    private Integer version;
+//    /**
+//     * 多租户
+//     * 不用配置实体字段,但是数据库需要该字段
+//     */
+//    private Long tenantId;
+}

+ 0 - 60
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/PostgresMetaObjectHandler.java

@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres;
-
-import java.time.LocalDateTime;
-
-import org.apache.ibatis.reflection.MetaObject;
-
-import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
-
-/**
- * 测试,自定义元对象字段填充控制器,实现公共字段自动写入
- *
- * @author hubin
- * @since 2017-06-25
- */
-public class PostgresMetaObjectHandler implements MetaObjectHandler {
-
-    /**
-     * 测试 user 表 name 字段为空自动填充
-     */
-    @Override
-    public void insertFill(MetaObject metaObject) {
-        System.out.println("*************************");
-        System.out.println("insert of postgres fill");
-        System.out.println("*************************");
-        // 测试下划线
-        Object createDatetime = this.getFieldValByName("createDatetime", metaObject);
-        System.out.println("createDatetime=" + createDatetime);
-        if (createDatetime == null) {
-            //测试实体没有的字段,配置在公共填充,不应该set到实体里面
-            this.setInsertFieldValByName("createDatetime1", LocalDateTime.now(), metaObject)
-                .setInsertFieldValByName("createDatetime", LocalDateTime.now(), metaObject);
-        }
-    }
-
-    @Override
-    public void updateFill(MetaObject metaObject) {
-        System.out.println("*************************");
-        System.out.println("update of postgres fill");
-        System.out.println("*************************");
-        //测试实体没有的字段,配置在公共填充,不应该set到实体里面
-        this.setUpdateFieldValByName("updateDatetime1", LocalDateTime.now(), metaObject)
-            .setUpdateFieldValByName("updateDatetime", LocalDateTime.now(), metaObject);
-    }
-}
-

+ 0 - 234
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/PostgresTestDataMapperTest.java

@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2011-2019, hubin (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres;
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.test.mysql.entity.CommonData;
-import com.baomidou.mybatisplus.test.mysql.entity.CommonLogicData;
-import com.baomidou.mybatisplus.test.mysql.enums.TestEnum;
-import com.baomidou.mybatisplus.test.mysql.mapper.commons.CommonDataMapper;
-import com.baomidou.mybatisplus.test.mysql.mapper.commons.CommonLogicDataMapper;
-import com.baomidou.mybatisplus.test.postgres.entity.PgData;
-import com.baomidou.mybatisplus.test.postgres.mapper.PgDataMapper;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.MethodOrderer;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestMethodOrder;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Mybatis Plus mysql Junit Test
- *
- * @author hubin
- * @since 2018-06-05
- */
-@TestMethodOrder(MethodOrderer.Alphanumeric.class)
-@ExtendWith(SpringExtension.class)
-@ContextConfiguration(locations = {"classpath:postgres/spring-test-postgres.xml"})
-class PostgresTestDataMapperTest {
-
-    @Resource
-    private CommonDataMapper commonMapper;
-    @Resource
-    private CommonLogicDataMapper commonLogicMapper;
-    @Resource
-    private PgDataMapper pgMapper;
-
-    @Test
-    void a_insertForeach() {
-        for (int i = 1; i < 20; i++) {
-            Long id = (long) i;
-            commonMapper.insert(new CommonData().setTestInt(i).setTestStr(String.format("第%s条数据", i)).setId(id)
-                .setTestEnum(TestEnum.ONE));
-            commonLogicMapper.insert(new CommonLogicData().setTestInt(i).setTestStr(String.format("第%s条数据", i)).setId(id));
-            pgMapper.insert(new PgData().setGroup(i).setId(id).setPgInt(i).setPgInt2(i));
-        }
-    }
-
-    @Test
-    void b1_deleteById() {
-        Assertions.assertEquals(1, commonMapper.deleteById(1L));
-        Assertions.assertEquals(1, commonLogicMapper.deleteById(1L));
-        Assertions.assertEquals(1, pgMapper.deleteById(1L));
-    }
-
-    @Test
-    void b2_deleteByMap() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("id", 2L);
-        map.put("test_int", 5);
-        Assertions.assertEquals(0, commonMapper.deleteByMap(map));
-        Assertions.assertEquals(0, commonLogicMapper.deleteByMap(map));
-        Map<String, Object> map2 = new HashMap<>();
-        map2.put("id", 2L);
-        map2.put("\"group\"", 5);
-        map2.put("\"pgInt\"", 5);
-        Assertions.assertEquals(0, pgMapper.deleteByMap(map2));
-    }
-
-    @Test
-    void b3_delete() {
-        Assertions.assertEquals(1, commonMapper.delete(new QueryWrapper<CommonData>().lambda()
-            .eq(CommonData::getId, 2L)
-            .eq(CommonData::getTestInt, 2)));
-        Assertions.assertEquals(1, commonLogicMapper.delete(new QueryWrapper<CommonLogicData>().lambda()
-            .eq(CommonLogicData::getId, 2L)
-            .eq(CommonLogicData::getTestInt, 2)));
-        Assertions.assertEquals(1, pgMapper.delete(new QueryWrapper<PgData>().lambda()
-            .eq(PgData::getId, 2L)
-            .eq(PgData::getGroup, 2).eq(PgData::getPgInt, 2)));
-    }
-
-    @Test
-    void b4_deleteBatchIds() {
-        List<Long> ids = Arrays.asList(3L, 4L);
-        Assertions.assertEquals(2, commonMapper.deleteBatchIds(ids));
-        Assertions.assertEquals(2, commonLogicMapper.deleteBatchIds(ids));
-        Assertions.assertEquals(2, pgMapper.deleteBatchIds(ids));
-    }
-
-    @Test
-    void c1_updateById() {
-        Assertions.assertEquals(1, commonMapper.updateById(new CommonData().setId(5L).setTestInt(555)));
-        Assertions.assertEquals(1, commonLogicMapper.updateById(new CommonLogicData().setId(5L).setTestInt(555)));
-        Assertions.assertEquals(1, pgMapper.updateById(new PgData().setId(5L).setGroup(555).setPgInt(555)));
-    }
-
-    @Test
-    void c2_optimisticUpdateById() {
-        Assertions.assertEquals(1, commonMapper.updateById(new CommonData().setId(5L).setTestInt(556)
-            .setVersion(0)));
-    }
-
-    @Test
-    void c3_update() {
-        Assertions.assertEquals(1, commonMapper.update(
-            new CommonData().setTestInt(666),
-            new UpdateWrapper<CommonData>().lambda().eq(CommonData::getId, 6L)
-                .eq(CommonData::getTestInt, 6)));
-        Assertions.assertEquals(1, commonLogicMapper.update(
-            new CommonLogicData().setTestInt(666),
-            new UpdateWrapper<CommonLogicData>().lambda().eq(CommonLogicData::getId, 6L)
-                .eq(CommonLogicData::getTestInt, 6)));
-        Assertions.assertEquals(1, pgMapper.update(
-            new PgData().setGroup(666).setPgInt(555),
-            new UpdateWrapper<PgData>().lambda().eq(PgData::getId, 6L)
-                .eq(PgData::getGroup, 6).eq(PgData::getPgInt, 6)));
-    }
-
-    @Test
-    void d1_getAllNoTenant() {
-        commonMapper.getAllNoTenant();
-    }
-
-    @Test
-    void d2_selectById() {
-        long id = 6L;
-        Assertions.assertNotNull(commonMapper.selectById(id).getTestEnum());
-        Assertions.assertNotNull(commonLogicMapper.selectById(id));
-        Assertions.assertNotNull(pgMapper.selectById(id));
-    }
-
-    @Test
-    void d3_selectBatchIds() {
-        List<Long> ids = Arrays.asList(7L, 8L);
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonMapper.selectBatchIds(ids)));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonLogicMapper.selectBatchIds(ids)));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(pgMapper.selectBatchIds(ids)));
-    }
-
-    @Test
-    void d4_selectByMap() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("id", 9L);
-        map.put("test_int", 9);
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonMapper.selectByMap(map)));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonLogicMapper.selectByMap(map)));
-        Map<String, Object> map2 = new HashMap<>();
-        map2.put("id", 9L);
-        map2.put("\"group\"", 9);
-        map2.put("\"pgInt\"", 9);
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(pgMapper.selectByMap(map2)));
-    }
-
-    @Test
-    void d5_selectOne() {
-        Assertions.assertNotNull(commonMapper.selectOne(new QueryWrapper<CommonData>().lambda()
-            .eq(CommonData::getId, 10L).eq(CommonData::getTestInt, 10)));
-        Assertions.assertNotNull(commonLogicMapper.selectOne(new QueryWrapper<CommonLogicData>().lambda()
-            .eq(CommonLogicData::getId, 10L).eq(CommonLogicData::getTestInt, 10)));
-        Assertions.assertNotNull(pgMapper.selectOne(new QueryWrapper<PgData>().lambda()
-            .eq(PgData::getId, 10L).eq(PgData::getGroup, 10).eq(PgData::getPgInt, 10)));
-    }
-
-    @Test
-    void d6_selectList() {
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonMapper.selectList(new QueryWrapper<CommonData>()
-            .lambda().eq(CommonData::getTestInt, 10))));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonLogicMapper.selectList(new QueryWrapper<CommonLogicData>()
-            .lambda().eq(CommonLogicData::getId, 10L).eq(CommonLogicData::getTestInt, 10))));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(pgMapper.selectList(new QueryWrapper<PgData>()
-            .lambda().eq(PgData::getId, 10L).eq(PgData::getGroup, 10).eq(PgData::getPgInt, 10))));
-    }
-
-    @Test
-    void d7_selectPage() {
-        IPage<CommonData> page = new Page<>(1, 5);
-        IPage<CommonData> dataPage = commonMapper.selectPage(page, null);
-        Assertions.assertSame(dataPage, page);
-        Assertions.assertNotEquals(0, dataPage.getRecords().size());
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(dataPage.getRecords()));
-        System.out.println(JSON.toJSONString(dataPage));
-
-        IPage<CommonLogicData> logicPage = new Page<>(1, 5);
-        IPage<CommonLogicData> logicDataPage = commonLogicMapper.selectPage(logicPage, null);
-        Assertions.assertSame(logicDataPage, logicPage);
-        Assertions.assertNotEquals(0, logicDataPage.getRecords().size());
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(logicDataPage.getRecords()));
-        System.out.println(JSON.toJSONString(logicDataPage));
-
-        IPage<PgData> pgPage = new Page<>(1, 5);
-        page.setSize(5).setCurrent(1);
-        IPage<PgData> pgDataPage = pgMapper.selectPage(pgPage, null);
-        Assertions.assertSame(pgDataPage, pgPage);
-        Assertions.assertNotEquals(0, pgDataPage.getRecords().size());
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(pgDataPage.getRecords()));
-        System.out.println(JSON.toJSONString(pgDataPage));
-    }
-
-    @Test
-    void d8_testApply() {
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonMapper.selectList(new QueryWrapper<CommonData>()
-            .apply("test_int = 12"))));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(commonLogicMapper.selectList(new QueryWrapper<CommonLogicData>()
-            .apply("test_int = 12"))));
-        Assertions.assertTrue(CollectionUtils.isNotEmpty(pgMapper.selectList(new QueryWrapper<PgData>()
-            .apply("\"group\" = 12").apply("\"pgInt\" = 12"))));
-    }
-}

+ 0 - 72
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/config/DBConfig.java

@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.jdbc.datasource.SimpleDriverDataSource;
-import org.springframework.jdbc.datasource.init.DataSourceInitializer;
-import org.springframework.jdbc.datasource.init.DatabasePopulator;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-import java.io.IOException;
-
-import javax.sql.DataSource;
-
-/**
- * @author miemie
- * @since 2018/6/7
- */
-@Configuration
-@EnableTransactionManagement
-public class DBConfig {
-
-    @Bean("dataSource")
-    public DataSource dataSource() {
-        SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
-        dataSource.setDriverClass(org.postgresql.Driver.class);
-        dataSource.setUrl("jdbc:postgresql://localhost:5432/mybatis_plus");
-        dataSource.setUsername("postgres");
-        dataSource.setPassword("123123");
-        return dataSource;
-    }
-
-    @Bean
-    public DataSourceTransactionManager transactionManager(DataSource ds) {
-        return new DataSourceTransactionManager(ds);
-    }
-
-    @Bean
-    public DataSourceInitializer dataSourceInitializer(DataSource dataSource) throws IOException {
-        final DataSourceInitializer initializer = new DataSourceInitializer();
-        initializer.setDataSource(dataSource);
-        initializer.setDatabasePopulator(databasePopulator());
-        initializer.setEnabled(true);
-        return initializer;
-    }
-
-    private DatabasePopulator databasePopulator() throws IOException {
-        ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator();
-        resourceDatabasePopulator.setContinueOnError(false);
-        resourceDatabasePopulator.addScripts(
-            new PathMatchingResourcePatternResolver().getResources("classpath:/postgres/*.sql")
-        );
-        return resourceDatabasePopulator;
-    }
-}

+ 0 - 111
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/config/MybatisPlusConfig.java

@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres.config;
-
-import com.baomidou.mybatisplus.core.MybatisConfiguration;
-import com.baomidou.mybatisplus.core.config.GlobalConfig;
-import com.baomidou.mybatisplus.core.parser.ISqlParser;
-import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
-import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
-import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
-import com.baomidou.mybatisplus.test.postgres.PostgresMetaObjectHandler;
-import net.sf.jsqlparser.expression.Expression;
-import net.sf.jsqlparser.expression.LongValue;
-import org.apache.ibatis.session.SqlSessionFactory;
-import org.apache.ibatis.type.JdbcType;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import javax.sql.DataSource;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Mybatis Plus Config
- *
- * @author Caratacus
- * @since 2017/4/1
- */
-@Configuration
-@MapperScan({"com.baomidou.mybatisplus.test.base.mapper.commons", "com.baomidou.mybatisplus.test.base.mapper.pg"})
-public class MybatisPlusConfig {
-
-    @Bean("mybatisSqlSession")
-    public SqlSessionFactory sqlSessionFactory(DataSource dataSource, GlobalConfig globalConfig,
-                                               PaginationInterceptor paginationInterceptor) throws Exception {
-        MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
-        /* 数据源 */
-        sqlSessionFactory.setDataSource(dataSource);
-        /* 枚举扫描 */
-        sqlSessionFactory.setTypeEnumsPackage("com.baomidou.mybatisplus.test.base.enums");
-        /* entity扫描,mybatis的Alias功能 */
-        MybatisConfiguration configuration = new MybatisConfiguration();
-        configuration.setJdbcTypeForNull(JdbcType.NULL);
-        /* 驼峰转下划线 */
-        configuration.setMapUnderscoreToCamelCase(true);
-        /* 分页插件 */
-        configuration.addInterceptor(paginationInterceptor);
-        /* 乐观锁插件 */
-        configuration.addInterceptor(new OptimisticLockerInterceptor());
-        sqlSessionFactory.setConfiguration(configuration);
-        /* 自动填充插件 */
-        globalConfig.setMetaObjectHandler(new PostgresMetaObjectHandler());
-        sqlSessionFactory.setGlobalConfig(globalConfig);
-        return sqlSessionFactory.getObject();
-    }
-
-    @Bean
-    public GlobalConfig globalConfig() {
-        GlobalConfig conf = new GlobalConfig();
-        conf.setDbConfig(new GlobalConfig.DbConfig());
-        return conf;
-    }
-
-    @Bean
-    public PaginationInterceptor paginationInterceptor() {
-        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
-        /*
-         * 【测试多租户】 SQL 解析处理拦截器<br>
-         * 这里固定写成住户 1 实际情况你可以从cookie读取,因此数据看不到 【 麻花藤 】 这条记录( 注意观察 SQL )<br>
-         */
-        List<ISqlParser> sqlParserList = new ArrayList<>();
-        TenantSqlParser tenantSqlParser = new TenantSqlParser();
-        tenantSqlParser.setTenantHandler(new TenantHandler() {
-
-            @Override
-            public Expression getTenantId(boolean where) {
-                return new LongValue(1L);
-            }
-
-            @Override
-            public String getTenantIdColumn() {
-                return "tenant_id";
-            }
-
-            @Override
-            public boolean doTableFilter(String tableName) {
-                // 这里可以判断是否过滤表
-                return "common_logic_data".equals(tableName) || "pg_data".equals(tableName);
-            }
-        });
-        sqlParserList.add(tenantSqlParser);
-        paginationInterceptor.setSqlParserList(sqlParserList);
-        return paginationInterceptor;
-    }
-}

+ 0 - 36
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/entity/PgData.java

@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-/**
- * @author miemie
- * @since 2018-08-06
- */
-@Data
-@Accessors(chain = true)
-public class PgData {
-
-    private Long id;
-    @TableField("\"pgInt\"")
-    private Integer pgInt;
-    private Integer pgInt2;
-    @TableField("\"group\"")
-    private Integer group;
-}

+ 0 - 25
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/postgres/mapper/PgDataMapper.java

@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * <p>
- * https://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.baomidou.mybatisplus.test.postgres.mapper;
-
-import com.baomidou.mybatisplus.test.mysql.MyBaseMapper;
-import com.baomidou.mybatisplus.test.postgres.entity.PgData;
-
-/**
- * @author miemie
- * @since 2018-08-06
- */
-public interface PgDataMapper extends MyBaseMapper<PgData> {}

+ 0 - 9
mybatis-plus/src/test/resources/postgres/spring-test-postgres.xml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xmlns="http://www.springframework.org/schema/beans"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
-
-    <context:component-scan base-package="com.baomidou.mybatisplus.test.postgres.config"/>
-</beans>

+ 0 - 30
mybatis-plus/src/test/resources/postgres/test_data.ddl.sql

@@ -1,30 +0,0 @@
-drop table if exists public.common_data;
-drop table if exists public.common_logic_data;
-drop table if exists public.pg_data;
-CREATE TABLE public.common_data (
-    id        BIGINT primary key,
-    test_int  integer,
-    test_str  varchar(50),
-    c_time    timestamp,
-    u_time    timestamp,
-    version   integer default 0,
-    test_enum integer,
-    tenant_id bigint
-);
-
-CREATE TABLE public.common_logic_data (
-    id       BIGINT primary key,
-    test_int integer,
-    test_str varchar(50),
-    c_time   timestamp,
-    u_time   timestamp,
-    deleted  smallint default 0,
-    version  integer  default 0
-);
-
-CREATE TABLE public.pg_data (
-    id      BIGINT primary key,
-    "pgInt" integer,
-    pg_int2 integer,
-    "group" integer
-);