quarkiverse / quarkus-mybatis

Quarkus MyBatis Extension
Apache License 2.0
89 stars 33 forks source link

I wish add the plugins deal in mybatis-config.xml #208

Open rengang66 opened 2 years ago

rengang66 commented 2 years ago

for example ,my mybatis-config.xml has content:

In MyBatis extension ,The plugin needs to be processed in the method setupconfiguration in the MyBatisProcessor Class.

rengang66 commented 2 years ago
rengang66 commented 2 years ago
<plugins>
    <plugin interceptor="com.github.pagehelper.PageInterceptor">            
            <property name="helperDialect" value="mysql" />
            <property name="supportMethodsArguments" value="true" />
            <property name="params" value="count=countSql" />
    </plugin>
</plugins>``
zhfeng commented 2 years ago

It would be helpful if you can provide a simple example or test for using plugins. I think it should work in JVM mode but maybe need some tricks to work in Native mode.

wenpengpeng commented 1 year ago
<plugins>
  <plugin interceptor="com.github.pagehelper.PageInterceptor">            
          <property name="helperDialect" value="mysql" />
          <property name="supportMethodsArguments" value="true" />
          <property name="params" value="count=countSql" />
  </plugin>
</plugins>``

Have you achieved it? How should it be implemented?

zhfeng commented 1 year ago

I'm not very sure that <plugins> is supported in mybatis. If it does, I think we need a test to verify if it works.

wenpengpeng commented 1 year ago
<plugins>
    <plugin interceptor="com.github.pagehelper.PageInterceptor">            
            <property name="helperDialect" value="mysql" />
            <property name="supportMethodsArguments" value="true" />
            <property name="params" value="count=countSql" />
    </plugin>
</plugins>``

Have you achieved it? How should it be implemented?

if you want use PageHelper you can see this link: https://github.com/quarkiverse/quarkus-mybatis/issues/166

zhfeng commented 1 year ago

I see but it looks like with mybatis-plus but not mybatis?

wenpengpeng commented 1 year ago

I see but it looks like with mybatis-plus but not mybatis?

you can use it in the same way.