google-code-export / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Spring intergration now can supported multiple configuration xml files? #456

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?

Please describe the problem.  Unit tests are best!

What is the expected output? What do you see instead?

Please provide any additional information below.

Original issue reported on code.google.com by Randy...@gmail.com on 5 Dec 2011 at 1:06

GoogleCodeExporter commented 9 years ago
mybatis-spring-1.0.2

Original comment by Randy...@gmail.com on 5 Dec 2011 at 1:07

GoogleCodeExporter commented 9 years ago
Randy, please provide any extra info. I cannot understand if you are reporting 
a bug or asking a question.

Thanks in advance!

Original comment by eduardo.macarron on 5 Dec 2011 at 4:30

GoogleCodeExporter commented 9 years ago
like in spring 2.5.5 configure file configLocations property configure list:
    <bean id="sqlMapClientG4" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocations">
            <list>
                <value>config/g4/g4.sqlmap.xml</value>
                <value>config/app/app.sqlmap.xml</value>
                <!-- <value>config/app/other.sqlmap.xml</value>-->  
            </list>
        </property>
        <property name="dataSource" ref="dataSourceG4" />
    </bean>

mybatis3-spring:

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="myDataSource" />

        <!-- only assigned single configuration file-->
        <property name="configLocation" value="classpath:configuration.xml"/>
    </bean>

Original comment by Randy...@gmail.com on 6 Dec 2011 at 1:57

GoogleCodeExporter commented 9 years ago
Understood. 

Use the "mapperLocations" property. It works in the same way.

Original comment by eduardo.macarron on 6 Dec 2011 at 4:09

GoogleCodeExporter commented 9 years ago
eduardo, "mapperLocations" does not work the same way as "configLocations".  In 

org.springframework.orm.ibatis.SqlMapClientFactoryBean, you could use
"configLocation" if you had one configuration,
"configLocations" if you had multiple configurations,
"mappingLocations" if you wanted to look for multiple mapping locations

In org.mybatis.spring.SqlSessionFactoryBean, the possibilities are
"configLocation" if you have one configuration, and
"mapperLocations" (equivalent to the old "mappingLocations").

It doesn't appear there is an equivalent to the old "configLocations", which 
may be an issue if we want to convert from ibatis to mybatis.

Thanks,
Paul

Original comment by vonna...@gmail.com on 10 Apr 2012 at 10:39