Skip to content

Commit

Permalink
Let batch-update dialog not update already exported specimen
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Sep 20, 2021
1 parent 8e9c649 commit 0b2fca6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0b2fca6

Please sign in to comment.