mybaits parameterType配置

通過個人試驗,發現這個參數似乎沒什麼用,mapper中的參數列表爲@Param("insurerIdList") List<String> insurerIdList, @Param("startMonth") String startDate

這個可以說是兩種類型的,但是對於mybatis都一樣,而且,parameterType寫與不寫,都可以,甚至我寫成parameterType='int'也是可以執行的。

parameterTypeThe fully qualified class name or alias for the parameter that will be passed into this statement. This attribute is optional because MyBatis can calculate the TypeHandler to use out of the actual parameter passed to the statement. Default is unset.

官網上這樣解釋的,這個只是個別名,但是也可以不寫,它自己可以對應上的,並傳給sql的statement中使用。

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