Hi,
Is it possible to place the MyBatis Main Config file
("mybatis-config.xml") file inside src/main/resources ?
I have a Spring Boot project. I'm using MyBatis XML mappers and they
are located under src/main/resources. Good.
However, the main MyBatis XML config file needs to be placed under
src/main/webapp; if I place it under src/main/resources MyBatis does
not find it. This has also the undesired side effect that it becomes
available as a web resource. For example, this shouldn't work but it
does:
$ wget localhost:8080/mybatis-config.xml
This is how I configured it:
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="mybatis-config.xml" />
<property name="objectFactory" ref="springBeanObjectFactory" />
</bean>
I'm using this configuration to set the "objectFactory" and read VOs
as Spring Beans.
Do you know any way to place it unser src/main/resources? A solution
using Java annotations is also welcome, but I haven't been able to
make it work.
Thank you,
Vlad
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mybatis-user/CAP3Y0Vb3CwjxFcigbufw-4vzSG-DH_UeoF0NhuniQ2UPEgHF8g%40mail.gmail.com.