diff --git a/waltz-web/src/main/java/org/finos/waltz/web/endpoints/extracts/SurveyRunExtractor.java b/waltz-web/src/main/java/org/finos/waltz/web/endpoints/extracts/SurveyRunExtractor.java index 82b34737f2..b522f4c4e4 100644 --- a/waltz-web/src/main/java/org/finos/waltz/web/endpoints/extracts/SurveyRunExtractor.java +++ b/waltz-web/src/main/java/org/finos/waltz/web/endpoints/extracts/SurveyRunExtractor.java @@ -48,8 +48,8 @@ public class SurveyRunExtractor extends DirectQueryBasedDataExtractor { private static final Logger LOG = LoggerFactory.getLogger(SurveyRunExtractor.class); - private static List SURVEY_RESPONSE_FIELDS; - private static List SURVEY_INSTANCE_FIELDS; + private static final List> SURVEY_RESPONSE_FIELDS; + private static final List> SURVEY_INSTANCE_FIELDS; private final GenericSelectorFactory genericSelectorFactory = new GenericSelectorFactory(); @@ -59,12 +59,13 @@ public class SurveyRunExtractor extends DirectQueryBasedDataExtractor { SURVEY_QUESTION_RESPONSE.ENTITY_RESPONSE_ID, SURVEY_QUESTION_RESPONSE.ENTITY_RESPONSE_KIND); - Field answer = DSL.concat(SURVEY_QUESTION_RESPONSE.STRING_RESPONSE.coalesce(""), - SURVEY_QUESTION_RESPONSE.NUMBER_RESPONSE.cast(String.class).coalesce(""), - SURVEY_QUESTION_RESPONSE.BOOLEAN_RESPONSE.cast(String.class).coalesce(""), - SURVEY_QUESTION_RESPONSE.DATE_RESPONSE.cast(String.class).coalesce(""), - ENTITY_RESPONSE_NAME_FIELD.coalesce(""), - SURVEY_QUESTION_RESPONSE.LIST_RESPONSE_CONCAT.coalesce("")).as("Answer"); + Field answer = DSL.concat( + DSL.coalesce(SURVEY_QUESTION_RESPONSE.STRING_RESPONSE,""), + DSL.coalesce(SURVEY_QUESTION_RESPONSE.NUMBER_RESPONSE.cast(String.class), ""), + DSL.coalesce(SURVEY_QUESTION_RESPONSE.BOOLEAN_RESPONSE.cast(String.class), ""), + DSL.coalesce(SURVEY_QUESTION_RESPONSE.DATE_RESPONSE.cast(String.class), ""), + DSL.coalesce(ENTITY_RESPONSE_NAME_FIELD, ""), + DSL.coalesce(SURVEY_QUESTION_RESPONSE.LIST_RESPONSE_CONCAT, "")).as("Answer"); SURVEY_RESPONSE_FIELDS = ListUtilities.asList( SURVEY_QUESTION.SECTION_NAME.as("Section"), @@ -208,8 +209,8 @@ private SelectWhereStep getSurveysForEntity(EntityReference entityReference) private SelectConditionStep getSurveyRunInstances(long surveyRunId) { return dsl - .select(APPLICATION.NAME.coalesce(CHANGE_INITIATIVE.NAME).as("Entity Name"), - APPLICATION.ASSET_CODE.coalesce(CHANGE_INITIATIVE.EXTERNAL_ID).as("Entity Id"), + .select(DSL.coalesce(APPLICATION.NAME, CHANGE_INITIATIVE.NAME).as("Entity Name"), + DSL.coalesce(APPLICATION.ASSET_CODE, CHANGE_INITIATIVE.EXTERNAL_ID).as("Entity Id"), SURVEY_INSTANCE.ENTITY_KIND.as("Entity Kind"), SURVEY_INSTANCE.STATUS.as("Status")) .select(SURVEY_INSTANCE_FIELDS) @@ -235,8 +236,8 @@ private SelectSeekStep2 getSurveyInstanceResponses( private SelectConditionStep getSurveyRunWithResponses(long surveyRunId) { return dsl.select( - APPLICATION.NAME.coalesce(CHANGE_INITIATIVE.NAME).as("Entity Name"), - APPLICATION.ASSET_CODE.coalesce(CHANGE_INITIATIVE.EXTERNAL_ID).as("Entity Id"), + DSL.coalesce(APPLICATION.NAME, CHANGE_INITIATIVE.NAME).as("Entity Name"), + DSL.coalesce(APPLICATION.ASSET_CODE, CHANGE_INITIATIVE.EXTERNAL_ID).as("Entity Id"), SURVEY_INSTANCE.ENTITY_KIND.as("Entity Kind"), SURVEY_INSTANCE.STATUS.as("Status")) .select(SURVEY_RESPONSE_FIELDS)