iBatis to MyBatis migration efforts?
Asked Answered
A

3

6

I am using iBatis-2.3.4.726 in my production application. I want to migrate my production application to use MyBatis.

What points i need to consider while migration process?

Is there any configuration changes or MyBatis supports iBatis configuration as deprecated commands?

Abbie answered 18/8, 2012 at 15:25 Comment(0)
P
14

Before using migration guide mentioned by Satish (new repo link / wiki), make sure that you've read all the comments, especially the last one that list which changes have to be done manually after using converter:

  • <procedure> is deprecated in mybatis. Converter is changing this to <update>. This will create problems where we need result set from procedure call. So manually updated with <select>.
  • Dynamic query part mentioned inside <dynamic> tag are not converted by tool
  • Both # and $ can be escaped by doubling in iBatis. This is not required in mybatis.
  • typeAlias should be defined in sql-map-config instead of mapper itself.
  • When result map with groupBy changed into mybatis style using collection, id property is not set properly by the converter.
  • jdbcType="INT" is not recognized in mybatis. Updated to "INTEGER"
  • nullValue in resultMap deprecated, we need to update query with ISNULL expression.

What I'd like to add is that converter seems to drop timeout parameter that could be present in <procedure> tag in iBatis. Make sure to copy all occurences to the generated XML.

Pisgah answered 20/11, 2013 at 11:6 Comment(0)
A
4

The migration process is very easy, i got my answer from here

Hope this helps you too.

Abbie answered 20/8, 2012 at 16:42 Comment(1)
Do you mean github.com/mybatis/ibatis2mybatis in the list of repos?Floury
A
0

There is a tool on the Github, three steps to finish conversion.

  1. make sure you have install Apache ant.
  2. download code , and copy your ibatis files to the folder source
  3. go to the root directory of the code and run ant

Note conversion may fail ! I got message like: Sorry, I can`t migrate WHERE See console output for further details. Hope this helps

Aftershaft answered 13/9, 2018 at 8:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.