#12 Refactor bulk delete method

已合併
jonathan 4 年之前 將 8 次代碼提交從 kris/refactor_bulk_delete_methods合併至 master

@jonathan please review

@jonathan please review
jonathankris 4 年之前指派
jonathan requested changes 4 年之前
jonathan left a comment

a couple changes requested

@@ -361,3 +355,3 @@
return bulkDeleteWhere(condition, params);
}

public int bulkDeleteWhere(String whereClause) {
jonathan 評論 4 年之前

We still need the version of bulkDeleteWhere that just takes a String and no parameters Map

We still need the version of `bulkDeleteWhere` that just takes a String and no `parameters` Map
@@ -353,3 +343,1 @@
} else {
query = session.createQuery(deleteSql + field + " = :" + field)
.setParameter(field, value);
final var params = new HashMap<String, Object>();
jonathan 評論 4 年之前

No use of var in low-level code please

No use of `var` in low-level code please
jonathan reviewed 4 年之前
@@ -364,3 +359,4 @@
final Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
final String deleteSql = "DELETE FROM " + getEntityClass().getSimpleName() + " WHERE " + whereClause;
final Query query = session.createQuery(deleteSql);
parameters.forEach(query::setParameter);
jonathan 評論 4 年之前

Just prefix this line with if (!empty(parameters)) so that bulkDeleteWhere(String) can pass a null parameters arg.

Just prefix this line with `if (!empty(parameters))` so that `bulkDeleteWhere(String)` can pass a null `parameters` arg.
jonathan closed this pull request 4 年之前
jonathan 刪除分支 kris/refactor_bulk_delete_methods 4 年之前

Reviewers

jonathan requested changes 4 年之前
The pull request has been merged as e2783ac80f.
登入 才能加入這對話。
No reviewers
未選擇標籤
未選擇里程碑
No Assignees
2 參與者
訊息
截止日期

未設定截止日期。

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
尚未有任何內容