Skip to content

Commit

Permalink
Upgrading to the latest BQModuleProvider format
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Nov 24, 2023
1 parent 07c6350 commit 349245b
Showing 1 changed file with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,16 @@
package io.bootique.mybatis;

import io.bootique.BQModuleProvider;

import java.lang.reflect.Type;
import java.util.Collections;
import java.util.Map;
import io.bootique.bootstrap.BuiltModule;

public class MybatisModuleProvider implements BQModuleProvider {

@Override
public MybatisModule module() {
return new MybatisModule();
public BuiltModule buildModule() {
return BuiltModule.of(new MybatisModule())
.provider(this)
.description("Integrates Mybatis persistence library")
.config("mybatis", SqlSessionManagerFactory.class)
.build();
}

@Override
public Map<String, Type> configs() {
// TODO: config prefix is hardcoded. Refactor away from ConfigModule, and make provider
// generate config prefix, reusing it in metadata...
return Collections.singletonMap("mybatis", SqlSessionManagerFactory.class);
}

}

0 comments on commit 349245b

Please sign in to comment.