Mybatis-Plus非Spring环境整合:报错异常:NoClassDefFoundError: org/springframework/core/GenericTypeResolver

                    


最近在搞一个Netty与扫描枪通信项目;通过调研框架使用Mybatis-Plus+Druid作为获取数据库数据,结果整合报了个错,顺便记录下:

一,配置文件:

driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/xxxxxxx?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false
username=zhangsan
password=123root
# max active connection size 最大连接数
maxActive=50
# initial connection Size 初始化连接数
initialSize=5
# min idle connecton size 最小连接数,如果一直没人使用,连接池连接最小保持在5,idle是空闲的意思
minIdle=1
# max wait time (5000 mil seconds)  等待队列最长等5秒
maxWait=60000
timeBetweenEvictionRunsMillis=30000
minEvictableIdleTimeMillis=300000
testWhileIdle=true
testOnBorrow=false
testOnReturn=false
filters=stat,wall

二:整合Mybatis-plus与Druid数据库连接池的工具类:


package org.jd.data.netty.big.window.chat.util;

import cn.hutool.core.date.StopWatch;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
import org.apache.ibatis.logging.slf4j.Slf4jImpl;
import org.apache.ibatis.mapping.Environment;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;

import javax.sql.DataSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Enumeration;
import java.util.Objects;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

/**
 * try{}catch(){}finally{} 快捷键 ctrl+alt+t
 * 阿里巴巴开源数据库连接池(Druid)
 * 整合Mybatis-Plus工具类;单例模式,保证初始化资源与整个系统中执行一次
 */
public class ProxyDruidPoolUtil {
    private static DataSource dataSource;
    private static final String PROTOCOL_XML = "file";
    private static final String ENTRY_XML_SUFFIX = ".xml";
    private static SqlSession session;

    private ProxyDruidPoolUtil() {
        System.out.println("被调用多少次");
    }

    private static class ProxyDruidPoolUtiHandler {
        private static ProxyDruidPoolUtil newInstance = new ProxyDruidPoolUtil();
    }

    public static ProxyDruidPoolUtil getInstance() {
        return ProxyDruidPoolUtiHandler.newInstance;
    }

    static {
        StopWatch stopWatch = StopWatch.create("Druid-Pool-Init-Task");
        stopWatch.start("Druid数据库连接池初始化");
        Properties properties = new Properties();
        try {
            URL url = ProxyDruidPoolUtil.class.getClassLoader().getResource("config/druid.properties");
            properties.load(new FileInputStream(url.getPath()));
            dataSource = DruidDataSourceFactory.createDataSource(properties);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            stopWatch.stop();
            // 初始化SqlSession会话,整个项目中就一个SqlSession会话,但可以有多个连接
            initSqlSessionFactoryBuilder();
            System.out.println(stopWatch.getLastTaskName() + " 耗时: " + stopWatch.getTotalTimeSeconds() + "秒 | "+properties.toString());
        }
    }

    /**
     * 解析mapper.xml文件
     *
     * @param configuration
     * @param classPath
     * @throws IOException
     */
    private static void registryMapperXml(MybatisConfiguration configuration, String classPath) {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Enumeration mapper = contextClassLoader.getResources(classPath);
            while (mapper.hasMoreElements()) {
                URL url = mapper.nextElement();
                if (url.getProtocol().equals(PROTOCOL_XML)) {
                    String path = url.getPath();
                    File file = new File(path);
                    File[] files = file.listFiles();
                    for (File f : files) {
                        FileInputStream in = new FileInputStream(f);
                        XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(in, configuration, f.getPath(), configuration.getSqlFragments());
                        xmlMapperBuilder.parse();
                        in.close();
                    }
                } else {
                    JarURLConnection urlConnection = (JarURLConnection) url.openConnection();
                    JarFile jarFile = urlConnection.getJarFile();
                    Enumeration entries = jarFile.entries();
                    while (entries.hasMoreElements()) {
                        JarEntry jarEntry = entries.nextElement();
                        if (jarEntry.getName().endsWith(ENTRY_XML_SUFFIX)) {
                            InputStream in = jarFile.getInputStream(jarEntry);
                            XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(in, configuration, jarEntry.getName(), configuration.getSqlFragments());
                            xmlMapperBuilder.parse();
                            in.close();
                        }
                    }
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void initSqlSessionFactoryBuilder() {
        SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
        //这是mybatis-plus的配置对象,对mybatis的Configuration进行增强
        MybatisConfiguration configuration = new MybatisConfiguration();
        //这是初始化配置,后面会添加这部分代码
        initConfiguration(configuration);
        //这是初始化连接器,如mybatis-plus的分页插件
        configuration.addInterceptor(initInterceptor());
        //配置日志实现
        configuration.setLogImpl(Slf4jImpl.class);
        //扫描mapper接口所在包
        configuration.addMappers("org.jd.data.netty.big.window.chat.frame.ui.room.mapper");
        //构建mybatis-plus需要的globalize
        GlobalConfig globalConfig = GlobalConfigUtils.getGlobalConfig(configuration);
        //此参数会自动生成实现baseMapper的基础方法映射
        globalConfig.setSqlInjector(new DefaultSqlInjector());
        //设置id生成器
        globalConfig.setIdentifierGenerator(new DefaultIdentifierGenerator());
        //设置超类mapper
        globalConfig.setSuperMapperClass(BaseMapper.class);
        //设置数据源
        Environment environment = new Environment("1", new JdbcTransactionFactory(), getDataSource());
        configuration.setEnvironment(environment);
        // classpath路径下面
        registryMapperXml(configuration, "mapper");
        //构建sqlSessionFactory
        SqlSessionFactory sqlSessionFactory = builder.build(configuration);
        //创建session
        session = sqlSessionFactory.openSession();
    }

    /**
     * 初始化配置
     *
     * @param configuration
     */
    private static void initConfiguration(MybatisConfiguration configuration) {
        //开启驼峰大小写转换
        configuration.setMapUnderscoreToCamelCase(true);
        //配置添加数据自动返回数据主键
        configuration.setUseGeneratedKeys(true);
    }


    /**
     * mybatis-plus拦截器插件
     *
     * @return {@link Interceptor}
     */
    private static Interceptor initInterceptor() {
        //创建mybatis-plus插件对象
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //构建分页插件
        PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
        paginationInnerInterceptor.setDbType(DbType.MYSQL);
        paginationInnerInterceptor.setOverflow(true);
        // 每页允许最大500条
        paginationInnerInterceptor.setMaxLimit(500L);
        interceptor.addInnerInterceptor(paginationInnerInterceptor);
        return interceptor;
    }


    /**
     * 获取数据库连接
     *
     * @return {@link Connection}
     * @throws SQLException
     */
    public static Connection getConnection() throws SQLException {
        return session.getConnection();
    }


    /**
     * 获取数据库连接池对象
     *
     * @return {@link DataSource}
     */
    private static DataSource getDataSource() {
        return dataSource;
    }


    /**
     * 释放资源
     *
     * @param resultSet
     * @param statement
     * @param connection
     */
    public static void release(ResultSet resultSet, Statement statement, Connection connection) {
        if (Objects.nonNull(resultSet)) {
            try {
                resultSet.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        if (Objects.nonNull(statement)) {
            try {
                statement.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        // 归还数据库连接,并不是真的关闭
        if (Objects.nonNull(connection)) {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }


}

第三,测试类及准备数据:获取指定数据库中的所有表

package org.jd.data.frame.big.window.service;

import org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil;
import org.junit.Test;

import java.sql.*;

public class SysRoomMapperTest {

    @Test
    public void saveSysRoom() throws SQLException {
        Connection connection =ProxyDruidPoolUtil.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement("show table status");
        ResultSet resultSet = preparedStatement.executeQuery();
        while(resultSet.next()){
            ResultSetMetaData metaData = resultSet.getMetaData();
            int columnCount = metaData.getColumnCount();
            for (int i = 1; i <= columnCount; i++) {
                String name = metaData.getColumnLabel(i);
                String field = resultSet.getString(i);
                String result= String.format("%s:%s\t",name,field);
                System.out.printf(result);
            }
            System.out.println();
        }

    }
}

异常信息结果:

java.lang.NoClassDefFoundError: org/springframework/core/GenericTypeResolver

	at com.baomidou.mybatisplus.core.toolkit.reflect.SpringReflectionHelper.resolveTypeArguments(SpringReflectionHelper.java:30)
	at com.baomidou.mybatisplus.core.toolkit.reflect.GenericTypeUtils.resolveTypeArguments(GenericTypeUtils.java:34)
	at com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(ReflectionKit.java:97)
	at com.baomidou.mybatisplus.core.injector.AbstractSqlInjector.inspectInject(AbstractSqlInjector.java:43)
	at com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.parserInjector(MybatisMapperAnnotationBuilder.java:133)
	at com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.parse(MybatisMapperAnnotationBuilder.java:123)
	at com.baomidou.mybatisplus.core.MybatisMapperRegistry.addMapper(MybatisMapperRegistry.java:94)
	at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:106)
	at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:118)
	at com.baomidou.mybatisplus.core.MybatisConfiguration.addMappers(MybatisConfiguration.java:184)
	at org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil.initSqlSessionFactoryBuilder(ProxyDruidPoolUtil.java:137)
	at org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil.(ProxyDruidPoolUtil.java:78)
	at org.jd.data.frame.big.window.service.SysRoomMapperTest.saveSysRoom(SysRoomMapperTest.java:12)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.GenericTypeResolver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 38 more

 错误信息处于:

    at com.baomidou.mybatisplus.core.MybatisMapperRegistry.addMapper(MybatisMapperRegistry.java:94)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:106)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:118)

去扫描mapper接口时,运用到了Spring中的:org/springframework/core/GenericTypeResolver

这个类,结果没引入Spring-Core核心jar,故抛出该异常:


解决方案:引入该三角坐标


    org.springframework
    spring-core
    ${项目依赖的jar版本}

Mybatis-Plus非Spring环境整合:报错异常:NoClassDefFoundError: org/springframework/core/GenericTypeResolver_第1张图片


再次断点跟踪,已经可以扫描包下的所有mapper接口:

包:  org.jd.data.netty.big.window.chat.frame.ui.room.mapper

configuration.addMappers("org.jd.data.netty.big.window.chat.frame.ui.room.mapper");

Mybatis-Plus非Spring环境整合:报错异常:NoClassDefFoundError: org/springframework/core/GenericTypeResolver_第2张图片

四: 测试结果:


"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:53544,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\MybatisLog\lib\mybatis-agent-1.0.30-all.jar -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2020.2\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit5-rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\test-classes;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\classes;D:\maven_worker\Respository\Respository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;D:\maven_worker\Respository\Respository\cn\hutool\hutool-all\5.8.18\hutool-all-5.8.18.jar;D:\maven_worker\Respository\Respository\org\ehcache\ehcache\3.10.8\ehcache-3.10.8.jar;D:\maven_worker\Respository\Respository\javax\cache\cache-api\1.1.1\cache-api-1.1.1.jar;D:\maven_worker\Respository\Respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;D:\maven_worker\Respository\Respository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;D:\maven_worker\Respository\Respository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;D:\maven_worker\Respository\Respository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;D:\maven_worker\Respository\Respository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;D:\maven_worker\Respository\Respository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\maven_worker\Respository\Respository\org\jfree\jfreechart\1.5.4\jfreechart-1.5.4.jar;D:\maven_worker\Respository\Respository\mysql\mysql-connector-java\8.0.28\mysql-connector-java-8.0.28.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus\3.5.3.1\mybatis-plus-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-extension\3.5.3.1\mybatis-plus-extension-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-core\3.5.3.1\mybatis-plus-core-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-annotation\3.5.3.1\mybatis-plus-annotation-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\github\jsqlparser\jsqlparser\4.4\jsqlparser-4.4.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis\3.5.10\mybatis-3.5.10.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\maven_worker\Respository\Respository\com\alibaba\druid\1.2.16\druid-1.2.16.jar;D:\maven_worker\Respository\Respository\org\redisson\redisson\3.23.0\redisson-3.23.0.jar;D:\maven_worker\Respository\Respository\io\netty\netty-common\4.1.48.Final\netty-common-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec\4.1.48.Final\netty-codec-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-buffer\4.1.48.Final\netty-buffer-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-transport\4.1.48.Final\netty-transport-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver\4.1.48.Final\netty-resolver-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver-dns\4.1.48.Final\netty-resolver-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec-dns\4.1.48.Final\netty-codec-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-handler\4.1.48.Final\netty-handler-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\projectreactor\reactor-core\3.3.4.RELEASE\reactor-core-3.3.4.RELEASE.jar;D:\maven_worker\Respository\Respository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven_worker\Respository\Respository\io\reactivex\rxjava3\rxjava\3.1.6\rxjava-3.1.6.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling\2.0.11.Final\jboss-marshalling-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling-river\2.0.11.Final\jboss-marshalling-river-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\kryo\5.5.0\kryo-5.5.0.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\reflectasm\1.11.9\reflectasm-1.11.9.jar;D:\maven_worker\Respository\Respository\org\objenesis\objenesis\3.3\objenesis-3.3.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\minlog\1.3.1\minlog-1.3.1.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-annotations\2.10.3\jackson-annotations-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.3\jackson-dataformat-yaml-2.10.3.jar;D:\maven_worker\Respository\Respository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-core\2.10.3\jackson-core-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-databind\2.10.3\jackson-databind-2.10.3.jar;D:\maven_worker\Respository\Respository\net\bytebuddy\byte-buddy\1.10.8\byte-buddy-1.10.8.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-bean\5.1.6\jodd-bean-5.1.6.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-core\5.1.6\jodd-core-5.1.6.jar;D:\maven_worker\Respository\Respository\org\ini4j\ini4j\0.5.4\ini4j-0.5.4.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-core\5.2.5.RELEASE\spring-core-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-jcl\5.2.5.RELEASE\spring-jcl-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\junit\junit\4.13.2\junit-4.13.2.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.jd.data.frame.big.window.service.SysRoomMapperTest,saveSysRoom
Connected to the target VM, address: '127.0.0.1:53544', transport: 'socket'
Start: MyBatis Log EasyPlus
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Druid数据库连接池初始化 耗时: 1.7827706秒 | {url=jdbc:mysql://127.0.0.1:3306/XXXXX?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false, filters=stat,wall, maxActive=50, driverClassName=com.mysql.cj.jdbc.Driver, maxWait=60000, testWhileIdle=true, minEvictableIdleTimeMillis=300000, testOnReturn=false, username=root, minIdle=1, timeBetweenEvictionRunsMillis=30000, password=123456, testOnBorrow=false, initialSize=5}
Name:sys_checkout	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:57:12	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:退房信息表	
Name:sys_customer_enter	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 15:37:48	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:旅客入住信息表	
Name:sys_customer_type	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 14:50:31	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:旅客类型表	
Name:sys_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户分组表	
Name:sys_hotel_member	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:null	Create_time:2023-07-23 00:04:28	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:会员信息表	
Name:sys_news	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:5303	Avg_row_length:4062	Data_length:21544960	Max_data_length:0	Index_length:0	Data_free:4194304	Auto_increment:5571	Create_time:2023-07-20 16:16:15	Update_time:null	Check_time:null	Collation:utf8_general_ci	Checksum:null	Create_options:	Comment:	
Name:sys_organization	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:组织机构表	
Name:sys_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:6	Avg_row_length:2730	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:7	Create_time:2023-07-11 23:59:18	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统功能权限表	
Name:sys_random_color	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 20:20:05	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:颜色表	
Name:sys_reserve_info	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:26:48	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:预订信息表	
Name:sys_role	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统角色表	
Name:sys_role_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 20:47:58	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:角色组表	
Name:sys_role_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:角色权限表	
Name:sys_room	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 15:50:39	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间信息表	
Name:sys_room_classify	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:11:12	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间类型关联表	
Name:sys_room_type	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-23 09:32:57	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间类型表	
Name:sys_user	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:16384	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统用户表	
Name:sys_user_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:07	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户和组关联表	
Name:sys_user_organization	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户机构表	
Name:sys_user_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户权限表	
Name:sys_user_role	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户角色表	
Disconnected from the target VM, address: '127.0.0.1:53544', transport: 'socket'

Process finished with exit code 0

五:附测试相关类:


package org.jd.data.netty.big.window.chat.frame.ui.room.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jd.data.netty.big.window.chat.entity.SysRoom;


/**
 * 

* 房间信息表 Mapper 接口 *

* * @author yh19166 * @since 2023-07-23 */ @Mapper public interface SysRoomMapper extends BaseMapper { }

package org.jd.data.netty.big.window.chat.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 

* 房间信息表 *

* * @author yh19166 * @since 2023-07-23 */ @TableName("sys_room") @Data @NoArgsConstructor public class SysRoom implements Serializable { @TableField(exist = false) private static final long serialVersionUID = 1L; /** * 房间信息ID */ @TableId(value = "room_id", type = IdType.AUTO) private Long roomId; /** * 房间类型ID */ @TableField(value = "room_type_id") private Long roomTypeId; /** * 房间类型名称 */ private String roomTypeName; /** * 房间状态:0-已租 1未租 */ private Integer status; /** * 如: F3-502 */ private String location; /** * 010-5485625 */ private String roomTel; /** * 备注: */ private String remark; /** * 创建时间 */ private Date createTime; /** * 更新时间 */ private Date updateTime; /** * 逻辑删除:0--正常 1--删除 */ private Integer deleted; private Integer version; /** * 拓展字段1 */ private String otherExt1; /** * 拓展字段2 */ private String otherExt2; @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SysRoom)) return false; SysRoom sysRoom = (SysRoom) o; return Objects.equals(roomId, sysRoom.roomId) && Objects.equals(roomTypeId, sysRoom.roomTypeId) && Objects.equals(roomTypeName, sysRoom.roomTypeName) && Objects.equals(status, sysRoom.status) && Objects.equals(location, sysRoom.location) && Objects.equals(roomTel, sysRoom.roomTel) && Objects.equals(remark, sysRoom.remark) && Objects.equals(createTime, sysRoom.createTime) && Objects.equals(updateTime, sysRoom.updateTime) && Objects.equals(deleted, sysRoom.deleted) && Objects.equals(version, sysRoom.version) && Objects.equals(otherExt1, sysRoom.otherExt1) && Objects.equals(otherExt2, sysRoom.otherExt2); } @Override public int hashCode() { return Objects.hash(roomId, roomTypeId, roomTypeName, status, location, roomTel, remark, createTime, updateTime, deleted, version, otherExt1, otherExt2); } @Override public String toString() { return "SysRoom{" + ", roomId = " + roomId + ", roomTypeId = " + roomTypeId + ", roomTypeName = " + roomTypeName + ", status = " + status + ", location = " + location + ", roomTel = " + roomTel + ", remark = " + remark + ", createTime = " + createTime + ", updateTime = " + updateTime + ", deleted = " + deleted + ", version = " + version + ", otherExt1 = " + otherExt1 + ", otherExt2 = " + otherExt2 + "}"; } }

package org.jd.data.frame.big.window.service;

import org.apache.ibatis.session.SqlSession;
import org.jd.data.netty.big.window.chat.entity.SysRoom;
import org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomMapper;
import org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil;
import org.junit.Test;

import java.sql.*;
import java.util.Date;

public class SysRoomMapperTest {

    @Test
    public void findAllTables() throws SQLException {
        Connection connection = ProxyDruidPoolUtil.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement("show table status");
        ResultSet resultSet = preparedStatement.executeQuery();
        while (resultSet.next()) {
            ResultSetMetaData metaData = resultSet.getMetaData();
            int columnCount = metaData.getColumnCount();
            for (int i = 1; i <= columnCount; i++) {
                String name = metaData.getColumnLabel(i);
                String field = resultSet.getString(i);
                String result = String.format("%s:%s\t", name, field);
                System.out.printf(result);
            }
            System.out.println();
        }
        // 释放资源
        ProxyDruidPoolUtil.release(null, null, connection);
    }

    @Test
    public void saveSysRoom() {
        SqlSession session = ProxyDruidPoolUtil.getSession();
        SysRoomMapper sysRoomMapper = session.getMapper(SysRoomMapper.class);
        SysRoom sysRoom = new SysRoom();
        sysRoom.setRoomTypeName("豪华标准间");
        sysRoom.setRoomTypeId(10002L);
        sysRoom.setDeleted(0);
        sysRoom.setLocation("北京市海淀区中国人民银行科技楼");
        sysRoom.setRoomId(20000022L);
        sysRoom.setRoomTel("010-5634586");
        sysRoom.setStatus(0);
        sysRoom.setRemark("双人套房豪华间");
        sysRoom.setCreateTime(new Date());
        sysRoom.setUpdateTime(new Date());
        sysRoomMapper.insert(sysRoom);
        // 手动提交
        session.commit();
        session.close();
    }
}

测试结果:

"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -javaagent:C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\MybatisLog\lib\mybatis-agent-1.0.30-all.jar -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar=55040:D:\idea_worker\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit5-rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\test-classes;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\classes;D:\maven_worker\Respository\Respository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;D:\maven_worker\Respository\Respository\cn\hutool\hutool-all\5.8.18\hutool-all-5.8.18.jar;D:\maven_worker\Respository\Respository\org\ehcache\ehcache\3.10.8\ehcache-3.10.8.jar;D:\maven_worker\Respository\Respository\javax\cache\cache-api\1.1.1\cache-api-1.1.1.jar;D:\maven_worker\Respository\Respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;D:\maven_worker\Respository\Respository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;D:\maven_worker\Respository\Respository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;D:\maven_worker\Respository\Respository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;D:\maven_worker\Respository\Respository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;D:\maven_worker\Respository\Respository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\maven_worker\Respository\Respository\org\jfree\jfreechart\1.5.4\jfreechart-1.5.4.jar;D:\maven_worker\Respository\Respository\mysql\mysql-connector-java\8.0.28\mysql-connector-java-8.0.28.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus\3.5.3.1\mybatis-plus-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-extension\3.5.3.1\mybatis-plus-extension-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-core\3.5.3.1\mybatis-plus-core-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-annotation\3.5.3.1\mybatis-plus-annotation-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\github\jsqlparser\jsqlparser\4.4\jsqlparser-4.4.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis\3.5.10\mybatis-3.5.10.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\maven_worker\Respository\Respository\com\alibaba\druid\1.2.16\druid-1.2.16.jar;D:\maven_worker\Respository\Respository\org\redisson\redisson\3.23.0\redisson-3.23.0.jar;D:\maven_worker\Respository\Respository\io\netty\netty-common\4.1.48.Final\netty-common-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec\4.1.48.Final\netty-codec-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-buffer\4.1.48.Final\netty-buffer-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-transport\4.1.48.Final\netty-transport-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver\4.1.48.Final\netty-resolver-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver-dns\4.1.48.Final\netty-resolver-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec-dns\4.1.48.Final\netty-codec-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-handler\4.1.48.Final\netty-handler-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\projectreactor\reactor-core\3.3.4.RELEASE\reactor-core-3.3.4.RELEASE.jar;D:\maven_worker\Respository\Respository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven_worker\Respository\Respository\io\reactivex\rxjava3\rxjava\3.1.6\rxjava-3.1.6.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling\2.0.11.Final\jboss-marshalling-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling-river\2.0.11.Final\jboss-marshalling-river-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\kryo\5.5.0\kryo-5.5.0.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\reflectasm\1.11.9\reflectasm-1.11.9.jar;D:\maven_worker\Respository\Respository\org\objenesis\objenesis\3.3\objenesis-3.3.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\minlog\1.3.1\minlog-1.3.1.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-annotations\2.10.3\jackson-annotations-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.3\jackson-dataformat-yaml-2.10.3.jar;D:\maven_worker\Respository\Respository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-core\2.10.3\jackson-core-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-databind\2.10.3\jackson-databind-2.10.3.jar;D:\maven_worker\Respository\Respository\net\bytebuddy\byte-buddy\1.10.8\byte-buddy-1.10.8.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-bean\5.1.6\jodd-bean-5.1.6.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-core\5.1.6\jodd-core-5.1.6.jar;D:\maven_worker\Respository\Respository\org\ini4j\ini4j\0.5.4\ini4j-0.5.4.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-core\5.2.5.RELEASE\spring-core-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-jcl\5.2.5.RELEASE\spring-jcl-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\junit\junit\4.13.2\junit-4.13.2.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.jd.data.frame.big.window.service.SysRoomMapperTest,saveSysRoom
Start: MyBatis Log EasyPlus
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Druid数据库连接池初始化 耗时: 0.1241456秒 | {url=jdbc:mysql://127.0.0.1:3306/tope-pay-user?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false, filters=stat,wall, maxActive=50, driverClassName=com.mysql.cj.jdbc.Driver, maxWait=60000, testWhileIdle=true, minEvictableIdleTimeMillis=300000, testOnReturn=false, username=root, minIdle=1, timeBetweenEvictionRunsMillis=30000, password=123456, testOnBorrow=false, initialSize=5}
==>  SQLStructure: {"id":"org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomMapper.insert","originalSql":"INSERT INTO sys_room  ( room_type_id,\nroom_type_name,\nstatus,\nlocation,\nroom_tel,\nremark,\ncreate_time,\nupdate_time,\ndeleted )  VALUES  ( #{roomTypeId},\n#{roomTypeName},\n#{status},\n#{location},\n#{roomTel},\n#{remark},\n#{createTime},\n#{updateTime},\n#{deleted} )","completeSql":"INSERT INTO sys_room ( room_type_id, room_type_name, status, location, room_tel, remark, create_time, update_time, deleted ) VALUES ( 10002, '豪华标准间', 0, '北京市海淀区中国人民银行科技楼', '010-5634586', '双人套房豪华间', '2023-07-24 16:01:54', '2023-07-24 16:01:54', 0 )","parameter":"[{\"roomTypeId\":\"10002\"},{\"roomTypeName\":\"'豪华标准间'\"},{\"status\":\"0\"},{\"location\":\"'北京市海淀区中国人民银行科技楼'\"},{\"roomTel\":\"'010-5634586'\"},{\"remark\":\"'双人套房豪华间'\"},{\"createTime\":\"'2023-07-24 16:01:54'\"},{\"updateTime\":\"'2023-07-24 16:01:54'\"},{\"deleted\":\"0\"}]"}

Process finished with exit code 0

你可能感兴趣的:(spring,mybatis,java)