Skip to content

#58 added possibility to apply mapperInterface to MapperFactoryBean via ... #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2015
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