Skip to content

Commit

Permalink
Merge pull request #6215 from davidwatkins73/waltz-6209-jooq-coalesce
Browse files Browse the repository at this point in the history
Fixing calls to jOOQ deprecated methods
  • Loading branch information
jessica-woodland-scott-db authored Sep 5, 2022
2 parents 4732c61 + 1e05c64 commit d46b77d
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
public class SurveyRunExtractor extends DirectQueryBasedDataExtractor {

private static final Logger LOG = LoggerFactory.getLogger(SurveyRunExtractor.class);
private static List<Field> SURVEY_RESPONSE_FIELDS;
private static List<Field> SURVEY_INSTANCE_FIELDS;
private static final List<Field<?>> SURVEY_RESPONSE_FIELDS;
private static final List<Field<?>> SURVEY_INSTANCE_FIELDS;

private final GenericSelectorFactory genericSelectorFactory = new GenericSelectorFactory();

Expand All @@ -59,12 +59,13 @@ public class SurveyRunExtractor extends DirectQueryBasedDataExtractor {
SURVEY_QUESTION_RESPONSE.ENTITY_RESPONSE_ID,
SURVEY_QUESTION_RESPONSE.ENTITY_RESPONSE_KIND);

Field<String> 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<String> 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"),
Expand Down Expand Up @@ -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)
Expand All @@ -235,8 +236,8 @@ private SelectSeekStep2<Record, Integer, String> 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)
Expand Down

0 comments on commit d46b77d

Please sign in to comment.