Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/.project
*.epoch
*.log
*.iml
/.idea
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {

// the mapper interface is the original class of the bean
// but, the actual class of the bean is MapperFactoryBean
definition.getPropertyValues().add("mapperInterface", definition.getBeanClassName());
definition.getConstructorArgumentValues().addGenericArgumentValue(definition.getBeanClassName());
definition.setBeanClass(MapperFactoryBean.class);

definition.getPropertyValues().add("addToConfig", this.addToConfig);
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/mybatis/spring/mapper/MapperFactoryBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ public class MapperFactoryBean<T> extends SqlSessionDaoSupport implements Factor

private boolean addToConfig = true;

/**

public MapperFactoryBean(Class<T> mapperInterface) {
this.mapperInterface = mapperInterface;
}

public MapperFactoryBean() {
}

/**
* Sets the mapper interface of the MyBatis mapper
*
* @param mapperInterface class of the interface
Expand Down