Skip to content

Class.getDeclaredFields() 返回的元素顺序不确定可能会导致测试失败 #895

Open

Description

@saaivenk
Assert.assertEquals("SELECT id,user_name,address,state  FROM user " +
       "<where>" +
       "<if test=\"id != null\"> AND id = #{id}</if>" +
       "<if test=\"userName != null\"> AND user_name = #{userName}</if>" +
       "<if test=\"address != null\"> AND address = #{address, typeHandler=tk.mybatis.mapper.mapperhelper.ComplexEntityTest$AddressHandler}</if>" +
       "<if test=\"state != null\"> AND state = #{state}</if></where>", sql);

去

Assert.assertEquals("SELECT address,id,state,user_name  FROM user " +
        "<where>" +
        "<if test=\"address != null\"> AND address = #{address, typeHandler=tk.mybatis.mapper.mapperhelper.ComplexEntityTest$AddressHandler}</if>" +
        "<if test=\"id != null\"> AND id = #{id}</if>" +
         "<if test=\"state != null\"> AND state = #{state}</if>" +
         "<if test=\"userName != null\"> AND user_name = #{userName}</if></where>", sql);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions