diff --git a/src/main/java/edu/harvard/mcz/imagecapture/ui/dialog/BatchUpdateDialog.java b/src/main/java/edu/harvard/mcz/imagecapture/ui/dialog/BatchUpdateDialog.java index cf2d9a1..dba48b6 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/ui/dialog/BatchUpdateDialog.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/ui/dialog/BatchUpdateDialog.java @@ -109,7 +109,7 @@ private JComboBox getFieldSelectionJComboBox() { private void doApplyChange() { String fieldName = ((UpdateableField) this.getFieldSelectionJComboBox().getSelectedItem()).getDatabaseDescription(); - String conditionQuery = "WHERE " + fieldName + " LIKE :fromValue"; + String conditionQuery = "WHERE " + fieldName + " LIKE :fromValue AND s.nahimaExported = 0"; Session session; try { @@ -147,7 +147,7 @@ private void doApplyChange() { if (fieldName.startsWith("s.")) { updateQuery = session.createQuery("UPDATE Specimen s SET " + fieldName + "= :toValue " + conditionQuery); } else if (fieldName.startsWith("c.")) { - updateQuery = session.createQuery("UPDATE Collector c SET " + fieldName + "= :toValue " + conditionQuery); + updateQuery = session.createQuery("UPDATE Collector c LEFT JOIN c.specimen AS s SET " + fieldName + "= :toValue " + conditionQuery); } else { log.error("Unhandled updateable field prefix"); return;