Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/mybatis/dynamic/sql/BasicColumn.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -74,7 +74,7 @@ default String renderWithTableAndColumnAlias(TableAliasCalculator tableAliasCalc
* @param columns list of BasicColumn
* @return an array of BasicColumn
*/
static BasicColumn[] columnList(BasicColumn...columns) {
static BasicColumn[] columnList(BasicColumn... columns) {
return columns;
}
}
50 changes: 25 additions & 25 deletions src/main/java/org/mybatis/dynamic/sql/SqlBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static <T> InsertDSL.IntoGatherer<T> insert(T row) {
* @return the next step in the DSL
*/
@SafeVarargs
static <T> BatchInsertDSL.IntoGatherer<T> insertBatch(T...records) {
static <T> BatchInsertDSL.IntoGatherer<T> insertBatch(T... records) {
return BatchInsertDSL.insert(records);
}

Expand All @@ -171,7 +171,7 @@ static <T> BatchInsertDSL.IntoGatherer<T> insertBatch(Collection<T> records) {
* @return the next step in the DSL
*/
@SafeVarargs
static <T> MultiRowInsertDSL.IntoGatherer<T> insertMultiple(T...records) {
static <T> MultiRowInsertDSL.IntoGatherer<T> insertMultiple(T... records) {
return MultiRowInsertDSL.insert(records);
}

Expand All @@ -194,15 +194,15 @@ static InsertIntoNextStep insertInto(SqlTable table) {
return new InsertIntoNextStep(table);
}

static FromGatherer<SelectModel> select(BasicColumn...selectList) {
static FromGatherer<SelectModel> select(BasicColumn... selectList) {
return SelectDSL.select(selectList);
}

static FromGatherer<SelectModel> select(Collection<BasicColumn> selectList) {
return SelectDSL.select(selectList);
}

static FromGatherer<SelectModel> selectDistinct(BasicColumn...selectList) {
static FromGatherer<SelectModel> selectDistinct(BasicColumn... selectList) {
return SelectDSL.selectDistinct(selectList);
}

Expand Down Expand Up @@ -237,7 +237,7 @@ static WhereDSL where(ExistsPredicate existsPredicate, AndOrCriteriaGroup... sub

// where condition connectors
static <T> CriteriaGroup group(BindableColumn<T> column, VisitableCondition<T> condition,
AndOrCriteriaGroup...subCriteria) {
AndOrCriteriaGroup... subCriteria) {
return group(column, condition, Arrays.asList(subCriteria));
}

Expand All @@ -250,7 +250,7 @@ static <T> CriteriaGroup group(BindableColumn<T> column, VisitableCondition<T> c
.build();
}

static CriteriaGroup group(ExistsPredicate existsPredicate, AndOrCriteriaGroup...subCriteria) {
static CriteriaGroup group(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return group(existsPredicate, Arrays.asList(subCriteria));
}

Expand All @@ -262,7 +262,7 @@ static CriteriaGroup group(ExistsPredicate existsPredicate, List<AndOrCriteriaGr
.build();
}

static CriteriaGroup group(SqlCriterion initialCriterion, AndOrCriteriaGroup...subCriteria) {
static CriteriaGroup group(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return group(initialCriterion, Arrays.asList(subCriteria));
}

Expand All @@ -280,7 +280,7 @@ static CriteriaGroup group(List<AndOrCriteriaGroup> subCriteria) {
}

static <T> NotCriterion not(BindableColumn<T> column, VisitableCondition<T> condition,
AndOrCriteriaGroup...subCriteria) {
AndOrCriteriaGroup... subCriteria) {
return not(column, condition, Arrays.asList(subCriteria));
}

Expand All @@ -293,7 +293,7 @@ static <T> NotCriterion not(BindableColumn<T> column, VisitableCondition<T> cond
.build();
}

static NotCriterion not(ExistsPredicate existsPredicate, AndOrCriteriaGroup...subCriteria) {
static NotCriterion not(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return not(existsPredicate, Arrays.asList(subCriteria));
}

Expand All @@ -305,7 +305,7 @@ static NotCriterion not(ExistsPredicate existsPredicate, List<AndOrCriteriaGroup
.build();
}

static NotCriterion not(SqlCriterion initialCriterion, AndOrCriteriaGroup...subCriteria) {
static NotCriterion not(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return not(initialCriterion, Arrays.asList(subCriteria));
}

Expand All @@ -323,7 +323,7 @@ static NotCriterion not(List<AndOrCriteriaGroup> subCriteria) {
}

static <T> AndOrCriteriaGroup or(BindableColumn<T> column, VisitableCondition<T> condition,
AndOrCriteriaGroup...subCriteria) {
AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(ColumnAndConditionCriterion.withColumn(column)
.withCondition(condition)
Expand All @@ -333,7 +333,7 @@ static <T> AndOrCriteriaGroup or(BindableColumn<T> column, VisitableCondition<T>
.build();
}

static AndOrCriteriaGroup or(ExistsPredicate existsPredicate, AndOrCriteriaGroup...subCriteria) {
static AndOrCriteriaGroup or(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
Expand All @@ -342,7 +342,7 @@ static AndOrCriteriaGroup or(ExistsPredicate existsPredicate, AndOrCriteriaGroup
.build();
}

static AndOrCriteriaGroup or(SqlCriterion initialCriterion, AndOrCriteriaGroup...subCriteria) {
static AndOrCriteriaGroup or(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("or") //$NON-NLS-1$
.withInitialCriterion(initialCriterion)
Expand All @@ -358,7 +358,7 @@ static AndOrCriteriaGroup or(List<AndOrCriteriaGroup> subCriteria) {
}

static <T> AndOrCriteriaGroup and(BindableColumn<T> column, VisitableCondition<T> condition,
AndOrCriteriaGroup...subCriteria) {
AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(ColumnAndConditionCriterion.withColumn(column)
.withCondition(condition)
Expand All @@ -368,7 +368,7 @@ static <T> AndOrCriteriaGroup and(BindableColumn<T> column, VisitableCondition<T
.build();
}

static AndOrCriteriaGroup and(ExistsPredicate existsPredicate, AndOrCriteriaGroup...subCriteria) {
static AndOrCriteriaGroup and(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
Expand All @@ -377,7 +377,7 @@ static AndOrCriteriaGroup and(ExistsPredicate existsPredicate, AndOrCriteriaGrou
.build();
}

static AndOrCriteriaGroup and(SqlCriterion initialCriterion, AndOrCriteriaGroup...subCriteria) {
static AndOrCriteriaGroup and(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("and") //$NON-NLS-1$
.withInitialCriterion(initialCriterion)
Expand Down Expand Up @@ -657,7 +657,7 @@ static <T> IsLessThanOrEqualTo<T> isLessThanOrEqualToWhenPresent(Supplier<T> val
}

@SafeVarargs
static <T> IsIn<T> isIn(T...values) {
static <T> IsIn<T> isIn(T... values) {
return IsIn.of(values);
}

Expand All @@ -670,7 +670,7 @@ static <T> IsInWithSubselect<T> isIn(Buildable<SelectModel> selectModelBuilder)
}

@SafeVarargs
static <T> IsIn<T> isInWhenPresent(T...values) {
static <T> IsIn<T> isInWhenPresent(T... values) {
return IsIn.of(values).filter(Objects::nonNull);
}

Expand All @@ -679,7 +679,7 @@ static <T> IsIn<T> isInWhenPresent(Collection<T> values) {
}

@SafeVarargs
static <T> IsNotIn<T> isNotIn(T...values) {
static <T> IsNotIn<T> isNotIn(T... values) {
return IsNotIn.of(values);
}

Expand All @@ -692,7 +692,7 @@ static <T> IsNotInWithSubselect<T> isNotIn(Buildable<SelectModel> selectModelBui
}

@SafeVarargs
static <T> IsNotIn<T> isNotInWhenPresent(T...values) {
static <T> IsNotIn<T> isNotInWhenPresent(T... values) {
return IsNotIn.of(values).filter(Objects::nonNull);
}

Expand Down Expand Up @@ -807,31 +807,31 @@ static IsNotLikeCaseInsensitive isNotLikeCaseInsensitiveWhenPresent(Supplier<Str
return isNotLikeCaseInsensitiveWhenPresent(valueSupplier.get());
}

static IsInCaseInsensitive isInCaseInsensitive(String...values) {
static IsInCaseInsensitive isInCaseInsensitive(String... values) {
return IsInCaseInsensitive.of(values);
}

static IsInCaseInsensitive isInCaseInsensitive(Collection<String> values) {
return IsInCaseInsensitive.of(values);
}

static IsInCaseInsensitive isInCaseInsensitiveWhenPresent(String...values) {
static IsInCaseInsensitive isInCaseInsensitiveWhenPresent(String... values) {
return IsInCaseInsensitive.of(values).filter(Objects::nonNull);
}

static IsInCaseInsensitive isInCaseInsensitiveWhenPresent(Collection<String> values) {
return values == null ? IsInCaseInsensitive.empty() : IsInCaseInsensitive.of(values).filter(Objects::nonNull);
}

static IsNotInCaseInsensitive isNotInCaseInsensitive(String...values) {
static IsNotInCaseInsensitive isNotInCaseInsensitive(String... values) {
return IsNotInCaseInsensitive.of(values);
}

static IsNotInCaseInsensitive isNotInCaseInsensitive(Collection<String> values) {
return IsNotInCaseInsensitive.of(values);
}

static IsNotInCaseInsensitive isNotInCaseInsensitiveWhenPresent(String...values) {
static IsNotInCaseInsensitive isNotInCaseInsensitiveWhenPresent(String... values) {
return IsNotInCaseInsensitive.of(values).filter(Objects::nonNull);
}

Expand Down Expand Up @@ -885,7 +885,7 @@ public InsertSelectDSL withSelectStatement(Buildable<SelectModel> selectModelBui
.withSelectStatement(selectModelBuilder);
}

public InsertSelectDSL.SelectGatherer withColumnList(SqlColumn<?>...columns) {
public InsertSelectDSL.SelectGatherer withColumnList(SqlColumn<?>... columns) {
return InsertSelectDSL.insertInto(table)
.withColumnList(columns);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public BatchInsertModel<T> build() {
}

@SafeVarargs
public static <T> IntoGatherer<T> insert(T...records) {
public static <T> IntoGatherer<T> insert(T... records) {
return BatchInsertDSL.insert(Arrays.asList(records));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,7 @@ private InsertColumnGatherer(SqlTable table) {
this.table = table;
}

public SelectGatherer withColumnList(SqlColumn<?>...columns) {
public SelectGatherer withColumnList(SqlColumn<?>... columns) {
return withColumnList(Arrays.asList(columns));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public MultiRowInsertModel<T> build() {
}

@SafeVarargs
public static <T> IntoGatherer<T> insert(T...records) {
public static <T> IntoGatherer<T> insert(T... records) {
return MultiRowInsertDSL.insert(Arrays.asList(records));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,13 +53,13 @@ public TableExpression table() {
}

public T join(SqlTable joinTable, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addJoinSpecificationBuilder(joinTable, onJoinCriterion, JoinType.INNER, Arrays.asList(andJoinCriteria));
return getThis();
}

public T join(SqlTable joinTable, String tableAlias, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addTableAlias(joinTable, tableAlias);
return join(joinTable, onJoinCriterion, andJoinCriteria);
}
Expand All @@ -84,13 +84,13 @@ public T join(Buildable<SelectModel> subQuery, String tableAlias, JoinCriterion
}

public T leftJoin(SqlTable joinTable, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addJoinSpecificationBuilder(joinTable, onJoinCriterion, JoinType.LEFT, Arrays.asList(andJoinCriteria));
return getThis();
}

public T leftJoin(SqlTable joinTable, String tableAlias, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addTableAlias(joinTable, tableAlias);
return leftJoin(joinTable, onJoinCriterion, andJoinCriteria);
}
Expand All @@ -115,13 +115,13 @@ public T leftJoin(Buildable<SelectModel> subQuery, String tableAlias, JoinCriter
}

public T rightJoin(SqlTable joinTable, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addJoinSpecificationBuilder(joinTable, onJoinCriterion, JoinType.RIGHT, Arrays.asList(andJoinCriteria));
return getThis();
}

public T rightJoin(SqlTable joinTable, String tableAlias, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addTableAlias(joinTable, tableAlias);
return rightJoin(joinTable, onJoinCriterion, andJoinCriteria);
}
Expand All @@ -146,13 +146,13 @@ public T rightJoin(Buildable<SelectModel> subQuery, String tableAlias, JoinCrite
}

public T fullJoin(SqlTable joinTable, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addJoinSpecificationBuilder(joinTable, onJoinCriterion, JoinType.FULL, Arrays.asList(andJoinCriteria));
return getThis();
}

public T fullJoin(SqlTable joinTable, String tableAlias, JoinCriterion onJoinCriterion,
JoinCriterion...andJoinCriteria) {
JoinCriterion... andJoinCriteria) {
addTableAlias(joinTable, tableAlias);
return fullJoin(joinTable, onJoinCriterion, andJoinCriteria);
}
Expand Down
Loading