use of zjp.translateit.domain.Wordbook in project TranslateIt-api by zunpiau.
the class WordbookRepositoryImpl method save.
@Override
public int save(long uid, List<Wordbook> wordbooks) {
return template.batchUpdate("INSERT INTO wordbook ( uid, " + WORDBOOK_FILED + " ) VALUES(?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() {
@Override
public void setValues(PreparedStatement ps, int i) throws SQLException {
Wordbook wordbook = wordbooks.get(i);
ps.setLong(1, uid);
ps.setString(2, wordbook.getWord());
ps.setString(3, wordbook.getPhEn());
ps.setString(4, wordbook.getPhAm());
ps.setString(5, wordbook.getPhEnUrl());
ps.setString(6, wordbook.getPhAmUrl());
ps.setString(7, wordbook.getMean());
ps.setString(8, wordbook.getExchange());
ps.setString(9, wordbook.getSentence());
ps.setString(10, wordbook.getNote());
ps.setString(11, wordbook.getCategory());
}
@Override
public int getBatchSize() {
return wordbooks.size();
}
}).length;
}
Aggregations