mybatis-jpetstore-6.0.1 no configLocation or mapperLocations ?

70 views
Skip to first unread message

always_rick

unread,
Apr 7, 2013, 12:06:11 AM4/7/13
to mybati...@googlegroups.com
Hello all,

Why is it working WITHOUT configLocation and mapperLocations in mybatis-jpetstore-6.0.1?

mybatis-jpetstore-6.0.1 download link: http://mybatis.github.io/spring/sample.html 

In mybatis-jpetstore-6.0.1 applicationContext.xml,

   
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="typeAliasesPackage" value="org.mybatis.jpetstore.domain" />
    </bean>

   
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="org.mybatis.jpetstore.persistence" />
    </bean>

I know that typeAliasesPackage for scanning for domain objects and basePackage for for your mapper interface files. However, where is the setting for sqlmap/*.xml ?  Did I miss something?


Thanks in advance and have a nice weekend.


View this message in context: mybatis-jpetstore-6.0.1 no configLocation or mapperLocations ?
Sent from the mybatis-user mailing list archive at Nabble.com.

Eduardo Macarron

unread,
Apr 8, 2013, 3:08:28 PM4/8/13
to mybatis-user
Hi!

The MapperScannerConfigurer searchs for mapper interfaces and loads
them. Then mybatis will look for a file with the same name than the
interface but with an .xml extension and load it.

That is why no mybatis-config.xml file is used.

2013/4/7 always_rick <rick.sh...@gmail.com>:
> --
> 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 mybatis-user...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

always_rick

unread,
May 9, 2013, 3:14:40 AM5/9/13
to mybati...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages