mybaties報錯:There is no getter for property named 'table' in 'class java.lang.String'

報錯是由於xml裏獲取不到這個table參數

package com.xxx.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserMapper {

    User getUserById(long id);

    // @Select("select * from user_auth_0 ") // 查詢所有,改爲xml
    List<User> findAll();

    /**
     * 加@Param("table") 解決問題: org.apache.ibatis.reflection.ReflectionException:
     * There is no getter for property named 'table' in 'class java.lang.String'
     * @param table
     * @return
     */
    int createTableTest(@Param("table") String table);
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章