Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0 M3
    • Fix Version/s: None
    • Component/s: Data
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      iBatis 3 beta 1 introduced API changes which break the existing Spring support.

      1. genius-spring.tar.gz
        18 kB
        Putthibong Boonbong
      2. IBatisSpring.tar.gz
        31 kB
        Eduardo Macarron
      3. IBatisSpring.tar.gz
        21 kB
        Eduardo Macarron
      4. IBatisSpring.tar.gz
        20 kB
        Eduardo Macarron
      5. MapperFactoryBean_20091229.tar.gz
        12 kB
        Eduardo Macarron
      6. MapperFactoryBean_20091229-2.tar.gz
        12 kB
        Eduardo Macarron
      7. MapperFactoryBean_20100101.tar.gz
        12 kB
        Eduardo Macarron
      8. MapperFactoryBean.tar.gz
        15 kB
        Eduardo Macarron
      9. org.springframework.orm.ibatis3-201006100101.tar.gz
        15 kB
        Putthibong Boonbong
      10. org.springframework.orm.ibatis3-201006100756.tar.gz
        16 kB
        Putthibong Boonbong
      11. SqlSessionFactoryBean.java
        2 kB
        Gabriel Axel
      12. SqlSessionUtils.java
        13 kB
        AngerClown

        Issue Links

          Activity

          Hide
          Eduardo Macarron added a comment -

          I am sorry to hear that Juergen. I hope that Spring Data comes soon

          Let me upload some little changes I have on my workspace.

          1. Anger Clown tests did not work for me. The problem is that MyBatis 2.0.1 holds a hashmap with loaded xml files and Spring's ClassPathResource.toString() was returning "classpath resouce [org/....] istead of the raw resource name. I made a small change in SqlSessionFactoryBean to fix that.
          2. I moved MapperFactoryBean to the parent package because it is not a support class as it is not supposed to be extended.
          3. Also added my simple test that is a good sample for understanding how to use injected mappers
          4. Added Jonathan addToConfig property defaulting to true
          5. Full maven structure with a working pom

          You can have a look at a sample config on /orm-ibatis3/src/test/java/sample/context.xml

          	<bean id="sqlSessionFactory" class="org.springframework.orm.ibatis3.SqlSessionFactoryBean">
          		<property name="dataSource" ref="dataSource" />
          	</bean>
          
          	<bean id="userMapper"
          		class="org.springframework.orm.ibatis3.MapperFactoryBean">
          		<property name="sqlSessionFactory" ref="sqlSessionFactory" />
          		<property name="mapperInterface" value="sample.UserMapper" />
          	</bean>
          

          Just make a maven install to build it and run tests

          Maybe building a MyBatis namespace could made config less verbose.
          And even something like a component scan for mappers could be a good idea.

          Show
          Eduardo Macarron added a comment - I am sorry to hear that Juergen. I hope that Spring Data comes soon Let me upload some little changes I have on my workspace. Anger Clown tests did not work for me. The problem is that MyBatis 2.0.1 holds a hashmap with loaded xml files and Spring's ClassPathResource.toString() was returning "classpath resouce [org/....] istead of the raw resource name. I made a small change in SqlSessionFactoryBean to fix that. I moved MapperFactoryBean to the parent package because it is not a support class as it is not supposed to be extended. Also added my simple test that is a good sample for understanding how to use injected mappers Added Jonathan addToConfig property defaulting to true Full maven structure with a working pom You can have a look at a sample config on /orm-ibatis3/src/test/java/sample/context.xml <bean id= "sqlSessionFactory" class= "org.springframework.orm.ibatis3.SqlSessionFactoryBean" > <property name= "dataSource" ref= "dataSource" /> </bean> <bean id= "userMapper" class= "org.springframework.orm.ibatis3.MapperFactoryBean" > <property name= "sqlSessionFactory" ref= "sqlSessionFactory" /> <property name= "mapperInterface" value= "sample.UserMapper" /> </bean> Just make a maven install to build it and run tests Maybe building a MyBatis namespace could made config less verbose. And even something like a component scan for mappers could be a good idea.
          Hide
          Eduardo Macarron added a comment -

          Sorry my previous submission was wrong, I hit the submit button too fast

          Show
          Eduardo Macarron added a comment - Sorry my previous submission was wrong, I hit the submit button too fast
          Hide
          Thomas Risberg added a comment - - edited

          The support for MyBatis 3 will be provided as part of the Spring Data project in the datastore-sql component. See DATASQL-1.

          Show
          Thomas Risberg added a comment - - edited The support for MyBatis 3 will be provided as part of the Spring Data project in the datastore-sql component. See DATASQL-1 .
          Hide
          Putthibong Boonbong added a comment -

          mybatis-spring-1.0.0-RC1 has released, please try and report bug to mybatis issue tracking. Thank you.

          http://code.google.com/p/mybatis/

          Show
          Putthibong Boonbong added a comment - mybatis-spring-1.0.0-RC1 has released, please try and report bug to mybatis issue tracking. Thank you. http://code.google.com/p/mybatis/
          Hide
          Chris Beams added a comment -

          See resolution comments at DATAJDBC-2 for information on the MyBatis-Spring project and why integration need not occur in the core Spring Framework project nor the Spring Data family of projects.

          Show
          Chris Beams added a comment - See resolution comments at DATAJDBC-2 for information on the MyBatis-Spring project and why integration need not occur in the core Spring Framework project nor the Spring Data family of projects.

            People

            • Assignee:
              Costin Leau
              Reporter:
              Gabriel Axel
              Last updater:
              Trevor Marshall
            • Votes:
              50 Vote for this issue
              Watchers:
              56 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 41 weeks, 6 days ago