Skip to content

Commit

Permalink
Merge pull request #6679 from davidwatkins73/waltz-6678-bye-jdk8
Browse files Browse the repository at this point in the history
Removing wild card imports of org.jooq.Record
  • Loading branch information
davidwatkins73 authored Jul 14, 2023
2 parents e47f95e + 7efbead commit 627e85b
Show file tree
Hide file tree
Showing 45 changed files with 739 additions and 199 deletions.
8 changes: 7 additions & 1 deletion docs/development/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Waltz is built using [Maven](https://maven.apache.org/).

- [Git](https://git-scm.com/)
- [Maven 3](https://maven.apache.org/)
- [JDK 8](http://www.oracle.com/technetwork/java/javase/overview/index.html)
- [JDK 8+](http://www.oracle.com/technetwork/java/javase/overview/index.html) (see note below)
- [Node](https://nodejs.org/en/)
- [NPM](https://www.npmjs.com/) v6+
- [Sass](http://sass-lang.com/)
Expand All @@ -18,6 +18,12 @@ Waltz is built using [Maven](https://maven.apache.org/).
- [Liquibase](http://www.liquibase.org/) (recommended but not essential)
- [_jOOQ Pro_](https://www.jooq.org/download/) (if using Microsoft SQL Server)


**Note**:
When developing on JDK 9+ please ensure all class imports are explicit.
This is to prevent collisions between `java.lang.Record` and `org.jooq.Record` which can cause compilation errors (see issue: [#6678](https://github.com/finos/waltz/issues/6678))


## Obtaining the code

It is recommended that you clone the repository on GitHub to maintain your own fork and pull in changes as required.
Expand Down
32 changes: 28 additions & 4 deletions waltz-data/src/main/java/org/finos/waltz/data/JooqUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.finos.waltz.data;

import org.finos.waltz.schema.tables.records.ChangeLogRecord;
import org.finos.waltz.common.SetUtilities;
import org.finos.waltz.common.StringUtilities;
import org.finos.waltz.model.EndOfLifeStatus;
Expand All @@ -29,19 +28,44 @@
import org.finos.waltz.model.tally.ImmutableTally;
import org.finos.waltz.model.tally.OrderedTally;
import org.finos.waltz.model.tally.Tally;
import org.jooq.*;
import org.finos.waltz.schema.tables.records.ChangeLogRecord;
import org.jooq.Batch;
import org.jooq.CommonTableExpression;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record2;
import org.jooq.Record3;
import org.jooq.RecordMapper;
import org.jooq.SQL;
import org.jooq.SQLDialect;
import org.jooq.Select;
import org.jooq.SelectHavingStep;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableRecord;
import org.jooq.UpdatableRecord;
import org.jooq.impl.DSL;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.StringJoiner;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import static java.util.stream.Collectors.*;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList;
import static org.finos.waltz.common.Checks.checkNotNull;
import static org.finos.waltz.common.DateTimeUtilities.toLocalDate;
import static org.finos.waltz.common.DateTimeUtilities.toSqlDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
import org.finos.waltz.model.aggregate_overlay_diagram.overlay.ImmutableAttestationWidgetDatum;
import org.finos.waltz.schema.tables.AttestationInstance;
import org.finos.waltz.schema.tables.AttestationRun;
import org.jooq.*;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record5;
import org.jooq.Select;
import org.jooq.SelectConditionStep;
import org.jooq.impl.DSL;
import org.jooq.lambda.tuple.Tuple2;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.finos.waltz.data.app_group;

import org.finos.waltz.schema.tables.records.ApplicationGroupRecord;
import org.finos.waltz.data.SearchDao;
import org.finos.waltz.model.EntityKind;
import org.finos.waltz.model.EntityReference;
Expand All @@ -27,7 +26,15 @@
import org.finos.waltz.model.app_group.AppGroupMemberRole;
import org.finos.waltz.model.app_group.ImmutableAppGroup;
import org.finos.waltz.model.entity_search.EntitySearchOptions;
import org.jooq.*;
import org.finos.waltz.schema.tables.records.ApplicationGroupRecord;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.RecordMapper;
import org.jooq.Select;
import org.jooq.SelectConditionStep;
import org.jooq.SelectOrderByStep;
import org.jooq.impl.DSL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
Expand All @@ -38,13 +45,13 @@
import java.util.Set;
import java.util.stream.Collectors;

import static org.finos.waltz.common.StringUtilities.mkSafe;
import static org.finos.waltz.data.JooqUtilities.mkBasicTermSearch;
import static org.finos.waltz.data.SearchUtilities.mkTerms;
import static org.finos.waltz.schema.Tables.*;
import static org.finos.waltz.schema.tables.ApplicationGroup.APPLICATION_GROUP;
import static org.finos.waltz.schema.tables.ApplicationGroupMember.APPLICATION_GROUP_MEMBER;
import static org.finos.waltz.schema.tables.OrganisationalUnit.ORGANISATIONAL_UNIT;
import static org.finos.waltz.common.StringUtilities.mkSafe;
import static org.finos.waltz.data.JooqUtilities.mkBasicTermSearch;
import static org.finos.waltz.data.SearchUtilities.mkTerms;

@Repository
public class AppGroupDao implements SearchDao<AppGroup> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@
import org.finos.waltz.model.Criticality;
import org.finos.waltz.model.EntityKind;
import org.finos.waltz.model.EntityLifecycleStatus;
import org.finos.waltz.model.application.*;
import org.finos.waltz.model.application.AppRegistrationRequest;
import org.finos.waltz.model.application.AppRegistrationResponse;
import org.finos.waltz.model.application.Application;
import org.finos.waltz.model.application.ApplicationKind;
import org.finos.waltz.model.application.ImmutableAppRegistrationResponse;
import org.finos.waltz.model.application.ImmutableApplication;
import org.finos.waltz.model.application.LifecyclePhase;
import org.finos.waltz.model.external_identifier.ExternalIdValue;
import org.finos.waltz.model.rating.RagRating;
import org.finos.waltz.model.tally.Tally;
import org.finos.waltz.schema.tables.records.ApplicationRecord;
import org.jooq.*;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.RecordMapper;
import org.jooq.Select;
import org.jooq.exception.DataAccessException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,49 @@
import org.finos.waltz.common.SetUtilities;
import org.finos.waltz.data.GenericSelector;
import org.finos.waltz.data.InlineSelectFieldFactory;
import org.finos.waltz.model.*;
import org.finos.waltz.model.EntityKind;
import org.finos.waltz.model.EntityLifecycleStatus;
import org.finos.waltz.model.EntityReference;
import org.finos.waltz.model.ImmutableEntityReference;
import org.finos.waltz.model.Operation;
import org.finos.waltz.model.assessment_rating.AssessmentRating;
import org.finos.waltz.model.assessment_rating.*;
import org.finos.waltz.model.assessment_rating.AssessmentRatingOperations;
import org.finos.waltz.model.assessment_rating.AssessmentRatingSummaryCounts;
import org.finos.waltz.model.assessment_rating.ImmutableAssessmentRating;
import org.finos.waltz.model.assessment_rating.ImmutableAssessmentRatingOperations;
import org.finos.waltz.model.assessment_rating.ImmutableAssessmentRatingSummaryCounts;
import org.finos.waltz.model.assessment_rating.ImmutableRatingEntityList;
import org.finos.waltz.model.assessment_rating.RemoveAssessmentRatingCommand;
import org.finos.waltz.model.assessment_rating.SaveAssessmentRatingCommand;
import org.finos.waltz.model.assessment_rating.UpdateRatingCommand;
import org.finos.waltz.model.tally.ImmutableTally;
import org.finos.waltz.schema.tables.*;
import org.finos.waltz.schema.tables.AssessmentDefinition;
import org.finos.waltz.schema.tables.RatingSchemeItem;
import org.finos.waltz.schema.tables.records.AssessmentRatingRecord;
import org.jooq.*;
import org.jooq.AggregateFunction;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.DeleteConditionStep;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.Record5;
import org.jooq.RecordMapper;
import org.jooq.RecordUnmapper;
import org.jooq.Result;
import org.jooq.SelectConditionStep;
import org.jooq.UpdateConditionStep;
import org.jooq.impl.DSL;
import org.jooq.lambda.tuple.Tuple2;
import org.jooq.lambda.tuple.Tuple5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;

import static java.util.Collections.emptySet;
Expand All @@ -49,9 +77,12 @@
import static org.finos.waltz.common.ListUtilities.newArrayList;
import static org.finos.waltz.common.MapUtilities.groupBy;
import static org.finos.waltz.common.SetUtilities.*;
import static org.finos.waltz.common.StringUtilities.*;
import static org.finos.waltz.common.StringUtilities.mkSafe;
import static org.finos.waltz.common.StringUtilities.notEmpty;
import static org.finos.waltz.common.StringUtilities.sanitizeCharacters;
import static org.finos.waltz.model.EntityReference.mkRef;
import static org.finos.waltz.schema.Tables.*;
import static org.finos.waltz.schema.Tables.RATING_SCHEME_ITEM;
import static org.finos.waltz.schema.Tables.USER_ROLE;
import static org.finos.waltz.schema.tables.AssessmentDefinition.ASSESSMENT_DEFINITION;
import static org.finos.waltz.schema.tables.AssessmentRating.ASSESSMENT_RATING;
import static org.jooq.lambda.tuple.Tuple.tuple;
Expand All @@ -61,14 +92,9 @@ public class AssessmentRatingDao {

private static final org.finos.waltz.schema.tables.AssessmentRating ar = ASSESSMENT_RATING;
private static final AssessmentDefinition ad = ASSESSMENT_DEFINITION;
private static final Person p = PERSON;
private static final PermissionGroupInvolvement pgi = PERMISSION_GROUP_INVOLVEMENT;
private static final Involvement inv = INVOLVEMENT;
private static final InvolvementGroupEntry ige = INVOLVEMENT_GROUP_ENTRY;
private static final UserRole ur = USER_ROLE;
private static final RatingSchemeItem rsi = RATING_SCHEME_ITEM;

private static boolean DEFAULT_RATING_READ_ONLY_VALUE = false;
private static final boolean DEFAULT_RATING_READ_ONLY_VALUE = false;

private static final Field<String> ENTITY_NAME_FIELD = InlineSelectFieldFactory.mkNameField(
ar.ENTITY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,37 @@
import org.finos.waltz.model.EntityReference;
import org.finos.waltz.model.application.ApplicationKind;
import org.finos.waltz.model.application.LifecyclePhase;
import org.finos.waltz.model.attestation.*;
import org.finos.waltz.model.attestation.ApplicationAttestationInstanceSummary;
import org.finos.waltz.model.attestation.ApplicationAttestationSummaryCounts;
import org.finos.waltz.model.attestation.AttestEntityCommand;
import org.finos.waltz.model.attestation.AttestationCount;
import org.finos.waltz.model.attestation.AttestationInstance;
import org.finos.waltz.model.attestation.ImmutableApplicationAttestationInstanceSummary;
import org.finos.waltz.model.attestation.ImmutableApplicationAttestationSummaryCounts;
import org.finos.waltz.model.attestation.ImmutableAttestationCount;
import org.finos.waltz.model.attestation.ImmutableAttestationInstance;
import org.finos.waltz.model.attestation.ImmutableLatestMeasurableAttestationInfo;
import org.finos.waltz.model.attestation.ImmutableSyncRecipientsResponse;
import org.finos.waltz.model.attestation.LatestMeasurableAttestationInfo;
import org.finos.waltz.model.attestation.SyncRecipientsResponse;
import org.finos.waltz.schema.tables.records.AttestationInstanceRecord;
import org.jooq.*;
import org.jooq.CommonTableExpression;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record2;
import org.jooq.Record3;
import org.jooq.Record5;
import org.jooq.RecordMapper;
import org.jooq.Result;
import org.jooq.Row2;
import org.jooq.Select;
import org.jooq.SelectConditionStep;
import org.jooq.SelectJoinStep;
import org.jooq.SelectOnConditionStep;
import org.jooq.Table;
import org.jooq.impl.DSL;
import org.jooq.lambda.tuple.Tuple2;
import org.jooq.lambda.tuple.Tuple3;
Expand All @@ -45,10 +73,12 @@
import java.util.Set;

import static java.lang.String.format;
import static java.util.stream.Collectors.*;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.mapping;
import static java.util.stream.Collectors.toSet;
import static org.finos.waltz.common.Checks.checkNotNull;
import static org.finos.waltz.common.ListUtilities.newArrayList;
import static org.finos.waltz.common.StringUtilities.splitThenMap;
import static org.finos.waltz.model.EntityReference.mkRef;
import static org.finos.waltz.schema.Tables.*;
import static org.finos.waltz.schema.tables.Application.APPLICATION;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
package org.finos.waltz.data.attestation;


import org.finos.waltz.schema.tables.DataType;
import org.finos.waltz.schema.tables.*;
import org.finos.waltz.model.EntityKind;
import org.finos.waltz.model.EntityLifecycleStatus;
import org.finos.waltz.model.EntityReference;
import org.finos.waltz.model.attestation.ImmutableLogicalFlowAttestationPreChecks;
import org.finos.waltz.model.attestation.LogicalFlowAttestationPreChecks;
import org.jooq.*;
import org.finos.waltz.schema.tables.ApplicationGroup;
import org.finos.waltz.schema.tables.ApplicationGroupEntry;
import org.finos.waltz.schema.tables.DataType;
import org.finos.waltz.schema.tables.LogicalFlow;
import org.finos.waltz.schema.tables.LogicalFlowDecorator;
import org.jooq.CommonTableExpression;
import org.jooq.Condition;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record2;
import org.jooq.SelectOrderByStep;
import org.jooq.impl.DSL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import static org.finos.waltz.schema.Tables.*;
import static org.finos.waltz.schema.tables.DataType.DATA_TYPE;
import static org.finos.waltz.common.Checks.checkNotNull;
import static org.finos.waltz.schema.Tables.APPLICATION_GROUP;
import static org.finos.waltz.schema.Tables.APPLICATION_GROUP_ENTRY;
import static org.finos.waltz.schema.Tables.LOGICAL_FLOW;
import static org.finos.waltz.schema.Tables.LOGICAL_FLOW_DECORATOR;
import static org.finos.waltz.schema.tables.DataType.DATA_TYPE;

@Repository
public class AttestationPreCheckDao {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.finos.waltz.data.change_initiative;

import org.finos.waltz.schema.tables.records.ChangeInitiativeRecord;
import org.finos.waltz.data.FindEntityReferencesByIdSelector;
import org.finos.waltz.data.JooqUtilities;
import org.finos.waltz.model.EntityKind;
Expand All @@ -27,18 +26,25 @@
import org.finos.waltz.model.change_initiative.ChangeInitiative;
import org.finos.waltz.model.change_initiative.ChangeInitiativeKind;
import org.finos.waltz.model.change_initiative.ImmutableChangeInitiative;
import org.jooq.*;
import org.finos.waltz.schema.tables.records.ChangeInitiativeRecord;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.RecordMapper;
import org.jooq.Select;
import org.jooq.SelectConditionStep;
import org.jooq.SelectOrderByStep;
import org.jooq.impl.DSL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

import static org.finos.waltz.schema.tables.ChangeInitiative.CHANGE_INITIATIVE;
import static org.finos.waltz.schema.tables.EntityHierarchy.ENTITY_HIERARCHY;
import static java.util.Optional.ofNullable;
import static org.finos.waltz.common.Checks.checkNotNull;
import static org.finos.waltz.schema.tables.ChangeInitiative.CHANGE_INITIATIVE;
import static org.finos.waltz.schema.tables.EntityHierarchy.ENTITY_HIERARCHY;

@Repository
public class ChangeInitiativeDao implements FindEntityReferencesByIdSelector {
Expand Down
Loading

0 comments on commit 627e85b

Please sign in to comment.