org.mybatis.spring.annotation
Class InternalMapperFactoryBean<T>

java.lang.Object
  extended by org.mybatis.spring.MapperFactoryBean<T>
      extended by org.mybatis.spring.annotation.InternalMapperFactoryBean<T>
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean

public class InternalMapperFactoryBean<T>
extends MapperFactoryBean<T>

MapperScannerPostProcessor registers new mappers creating new MapperFactoryBeans but if there are other MapperFactoryBeans defined in the context their bean definitions are created before the MapperScannerPostProcessor is executed. It seems that the MapperFactoryBean's bean definition created by the MapperScannerPostProcessor is not the same that the one created by Spring. That makes autowire fail and an exception will be thrown indicating that sqlSessionFactory property is null and its required.

Seems that the problem is solved if another factory bean class is registered because bean definitions will be different and will not collide.

So this class just extends MapperFactoryBean and does nothing more.

This class is only for the MapperScannerPostProcessor and should never be used by final users.

Version:
$Id: InternalMapperFactoryBean.java 2965 2010-10-30 14:43:51Z simone.tripodi $
See Also:
MapperFactoryBean, MapperScannerPostProcessor

Constructor Summary
InternalMapperFactoryBean()
           
 
Method Summary
 
Methods inherited from class org.mybatis.spring.MapperFactoryBean
afterPropertiesSet, getObject, getObjectType, isSingleton, setAddToConfig, setMapperInterface, setSqlSessionFactory, setSqlSessionTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalMapperFactoryBean

public InternalMapperFactoryBean()


Copyright © 2010 MyBatis.org. All Rights Reserved.