diff --git a/backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/ValidityDate.java b/backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/ValidityDate.java index bc91eb7303..2c3715e4ba 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/ValidityDate.java +++ b/backend/src/main/java/com/bakdata/conquery/models/datasets/concepts/ValidityDate.java @@ -48,55 +48,32 @@ public boolean isForConnectorsTable() { boolean columnNotForConnector = column != null && !column.getTable().equals(connector.getTable()); - if (anyColumnNotForConnector || columnNotForConnector) { - log.error("{} does not belong to Connector[{}]#Table[{}]", this, connector.getId(), connector.getTable().getId()); - } - - return true; + return !anyColumnNotForConnector && !columnNotForConnector; } @JsonIgnore @ValidationMethod(message = "Single column date range (set via column) and two column date range (set via startColumn and endColumn) are exclusive.") public boolean isExclusiveValidityDates() { - - if ((column == null && startColumn != null && endColumn != null) - || (column != null && startColumn == null && endColumn == null)) { - return true; - } - log.error("Single column date range (set via column) and two column date range (set via startColumn and endColumn) are exclusive."); - return false; + return (column == null && startColumn != null && endColumn != null) + || (column != null && startColumn == null && endColumn == null); } @JsonIgnore @ValidationMethod(message = "Both columns of a two-column validity date have to be of type DATE.") public boolean isValidTwoColumnValidityDates() { - if (startColumn == null || endColumn == null) { return true; } - - if (startColumn.getType() == MajorTypeId.DATE && endColumn.getType() == MajorTypeId.DATE) { - return true; - } - - log.error("Start column [{}] and end column [{}] have to be of type DATE.", startColumn.getId(), endColumn.getId()); - return false; + return startColumn.getType() == MajorTypeId.DATE && endColumn.getType() == MajorTypeId.DATE; } @JsonIgnore @ValidationMethod(message = "Column is not of type DATE or DATE_RANGE.") public boolean isValidValidityDatesSingleColumn() { - if (column == null) { return true; } - - if (column.getType().isDateCompatible()) { - return true; - } - - log.error("ValidityDate-Column[{}] is not of type DATE or DATERANGE", column.getId()); - return false; + return column.getType().isDateCompatible(); } @JsonIgnore