Closed zhfeng closed 3 months ago
@p91paul can you check this could fix your issue by add quarkus.mybatis.database-id=h2 ? and in mybatis-config
quarkus.mybatis.database-id=h2
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <environments default="quarkus"> <environment id="quarkus"> <transactionManager type="JDBC"/> <dataSource type="QUARKUS"/> </environment> </environments> <databaseIdProvider type="QUARKUS_VENDOR"/> <mappers> <package name="com.example.demo"/> </mappers> </configuration>
Aslo if you want to run with the SessionFactory from xml configuration, you need to add MapperDataSource
MapperDataSource
package com.example.demo; import org.apache.ibatis.annotations.Mapper; import io.quarkiverse.mybatis.runtime.meta.MapperDataSource; @Mapper @MapperDataSource("xmlconfig") public interface DemoMapper { String getX(); }
@p91paul can you check this could fix your issue by add
quarkus.mybatis.database-id=h2
? and in mybatis-configAslo if you want to run with the SessionFactory from xml configuration, you need to add
MapperDataSource