在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java/ mybatis中,寫的mapper 的接口,返回值是int,可是實際過程中并沒有

mybatis中,寫的mapper 的接口,返回值是int,可是實際過程中并沒有用到呀?

圖片描述
這個int并沒有什么意義呀?

回答
編輯回答
鐧簞噯

返回的是修改記錄的條數(shù),如果是插入一條記錄應(yīng)該返回1,通過判斷是不是大于0知道插入是否成功?

2017年4月23日 20:50
編輯回答
憶往昔
 /**
   * Execute an insert statement.
   * @param statement Unique identifier matching the statement to execute.
   * @return int The number of rows affected by the insert.
   */
  int insert(String statement);

上面是SqlSession中的insert方法, 注釋中已經(jīng)很清楚的說到int是insert影響的行數(shù)。

2017年12月8日 10:00