mybatismybatis-mapper

MyBatis - how to define array in mybatis xml mapper file


I would like to define array of string in mybatis mapper and pass it as argument for java static method. It's possible?


Solution

  • Found one solution, I can define array in 'bind' tag and then pass it to method as argument:

            <bind name='exampleArray' value='{"one", "two", "three"}'/>
            ${@com.example.MybatisUtil@generate(exampleArray)}