#12 Refactor bulk delete method

Unito
jonathan ha unito 8 commit da kris/refactor_bulk_delete_methods a master 4 anni fa
kris 4 anni fa ha commentato

@jonathan please review

@jonathan please review
jonathan è stato assegnato da kris 4 anni fa
jonathan richieste modifiche 4 anni fa
jonathan lascia un commento

a couple changes requested

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

public int bulkDeleteWhere(String whereClause) {
jonathan 4 anni fa ha commentato

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 anni fa ha commentato

No use of var in low-level code please

No use of `var` in low-level code please
jonathan revisionato 4 anni fa
@@ -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 anni fa ha commentato

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 anni fa
jonathan branch kris/refactor_bulk_delete_methods eliminato 4 anni fa

Revisori

jonathan richieste modifiche 4 anni fa
La pull request è stata unita come e2783ac80f.
Effettua l'accesso per partecipare alla conversazione.
Nessun revisore
Nessuna etichetta
Nessuna milestone
Nessuna assegnatario
2 Partecipanti
Notifiche
Data di scadenza

Nessuna data di scadenza impostata.

Dipendenze

Questo problema attualmente non ha alcuna dipendenza.

Caricamento…
Non ci sono ancora contenuti.