Using mutiple datasources in myBatis and Spring -


i have application uses spring+mybatis , have mapper interface hold sql queries.

mapper.java

package it.helloworld.mybatis;  import it.helloworld.dao.model.numbers; import java.util.list; import org.apache.ibatis.annotations.select;  public interface mapper {      @select("select * numbers")     list<numbers> getnumbers();   } 

i have used mapperscannerconfigurer use mapper follows:

<bean class="org.mybatis.spring.mapper.mapperscannerconfigurer">     <property name="basepackage" value="it.helloworld.ibatis" />     <property name="sqlsessionfactorybeanname" value="sqlsessionfactory1" />     </bean> 

i have used name 'sqlsessionfactory1' because have mutiple datasources in application.

my question is:

i change interface xml file. meaning want store sql query in xml instead of interface. can configure mapperscannerconfigurer read sql xml instead of interface.? if yes, how.? if not, should use make minimum code changes.?

please check http://mybatis.github.io/spring/factorybean.html more details on configuring sqlsessionfactory1


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -