Skip to content

Commit

Permalink
- FIX: Fixed some issues with queries failing after recent release.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-raubach committed May 4, 2021
1 parent 3a3ccb3 commit 3fb85cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apply plugin: 'com.bmuschko.cargo-base'
compileJava.options.encoding = 'UTF-8'

group 'uk.ac.hutton.germinate'
version '4.1.5'
version '4.1.6'

sourceCompatibility = 1.8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.net.URISyntaxException;
import java.sql.*;
import java.util.*;
import java.util.logging.Logger;

import jhi.germinate.resource.*;
import jhi.germinate.resource.enums.ServerProperty;
Expand Down Expand Up @@ -43,7 +44,7 @@ public static List<AsyncExportResult> importData(String uuid)
.where(DATA_IMPORT_JOBS.UUID.eq(uuid))
.and(DATA_IMPORT_JOBS.STATUS.eq(DataImportJobsStatus.completed))
.and(DATA_IMPORT_JOBS.IMPORTED.eq(false))
.and(DSL.field("JSON_LENGTH({0})", DATA_IMPORT_JOBS.FEEDBACK.getName()).eq(0))
.and(DSL.field("JSON_LENGTH(" + DATA_IMPORT_JOBS.FEEDBACK.getName() + ")").eq(0))
.fetchAnyInto(DataImportJobsRecord.class);

if (record == null)
Expand Down Expand Up @@ -78,7 +79,8 @@ public static List<AsyncExportResult> importData(String uuid)
}
catch (Exception e)
{

e.printStackTrace();
Logger.getLogger("").severe(e.getLocalizedMessage());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public FileRepresentation getJson()
Set<String> years = new TreeSet<>();
Map<String, DatasetStats> datasetTypeToStats = new TreeMap<>();

Field<String> theYear = DSL.field("IF(ISNULL({2}), 'UNKNOWN', DATE_FORMAT({0}, {1}))", SQLDataType.VARCHAR, DATASETS.DATE_START, DSL.inline("%Y"), DATASETS.DATE_START.getName());
Field<String> theYear = DSL.field("IF(ISNULL(" + DATASETS.DATE_START.getName() + "), 'UNKNOWN', DATE_FORMAT({0}, {1}))", SQLDataType.VARCHAR, DATASETS.DATE_START, DSL.inline("%Y"));

context.select(
DATASETTYPES.DESCRIPTION.as("dataset_type"),
Expand Down

0 comments on commit 3fb85cd

Please sign in to comment.