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
Class/TypeAlias 'Order' not found ,multi-typeAliasesPackage problem on multi-datasource? #15
Comments
Thank you for the report! |
…beans rather than the first one. Related to #15
In 1.0.7, I have changed the parsing logic when there are multiple SqlSessionFactoryBean declaration in a Spring config file. In 1.0.6 and earlier, MyBatipse parses only the first bean to collect type aliases. This change should solve the error if...
Please let me know if 1.0.7 changes the situation... Thank you, |
Version 1.0.15 <bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<property name="basePackage" value="com.thinkgem.jeesite"/>
<property name="annotationClass" value="com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao"/>
</bean> Annotation: @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Component
public @interface MyBatisDao {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any
*/
String value() default "";
} There is no multiple classes with the same alias @MyBatisDao
public interface UserDao extends CrudDao<User> {
public User getByLoginName(User user);
} <select id="getByLoginName" resultType="User" parameterType="User">
SELECT
<include refid="userColumns"/>
FROM sys_user a... Multiple annotations found at this line: |
Hi @akacd , |
@harawata <!-- MyBatis begin -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="com.thinkgem.jeesite"/>
<property name="typeAliasesSuperType" value="com.thinkgem.jeesite.common.persistence.BaseEntity"/>
<property name="mapperLocations" value="classpath:/mappings/**/*.xml"/>
<property name="configLocation" value="classpath:/mybatis-config.xml"></property>
</bean>` |
every mapper xml file in mapper/a/.xml is ok
but every mapper xml file in mapper/b/.xml have error:
Class/TypeAlias 'Order' not found.
The text was updated successfully, but these errors were encountered: