Class/TypeAlias 'Order' not found ,multi-typeAliasesPackage problem on multi-datasource?
See original GitHub issue<bean id="sqlSessionFactory1" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="DataSource1" />
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="typeAliasesPackage" value="com.abc.entity.a" />
<property name="mapperLocations" value="classpath:mapper/a/*.xml" />
</bean>
<bean id="sqlSessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="DataSource2" />
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="typeAliasesPackage" value="com.abc.entity.b" />
<property name="mapperLocations" value="classpath:mapper/b/*.xml" />
</bean>
every mapper xml file in mapper/a/.xml is ok but every mapper xml file in mapper/b/.xml have error:
<select id="selectOrder" parameterType="String" resultType="Order">
select sql...
</select>
Class/TypeAlias ‘Order’ not found.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah…there is a bug in type alias search 😝
As it’s a different problem than #15, I have created a new issue #42 . Thanks for the help!
@harawata It’s like this: