use of zjp.translateit.dto.ModifyWordbook in project TranslateIt-api by zunpiau.
the class WordbookRepositoryImpl method update.
public int update(long uid, List<ModifyWordbook> wordbooks) {
return template.batchUpdate("UPDATE wordbook SET note = ?, category = ? WHERE uid = ? AND word = ? ", new BatchPreparedStatementSetter() {
@Override
public void setValues(PreparedStatement ps, int i) throws SQLException {
ModifyWordbook wordbook = wordbooks.get(i);
ps.setString(1, wordbook.getNote());
ps.setString(2, wordbook.getCategory());
ps.setLong(3, uid);
ps.setString(4, wordbook.getWord());
}
@Override
public int getBatchSize() {
return wordbooks.size();
}
}).length;
}
Aggregations