Skip to content

Commit 6153b3e

Browse files
committed
Polishing
1 parent bae9343 commit 6153b3e

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/main/java/org/mybatis/dynamic/sql/common/AbstractBooleanExpressionRenderer.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public abstract class AbstractBooleanExpressionRenderer<M extends AbstractBoolea
3333
private final CriterionRenderer criterionRenderer;
3434
private final String prefix;
3535

36-
protected AbstractBooleanExpressionRenderer(AbstractBuilder<M, ?> builder) {
36+
protected AbstractBooleanExpressionRenderer(String prefix, AbstractBuilder<M, ?> builder) {
3737
model = Objects.requireNonNull(builder.model);
3838

3939
criterionRenderer = new CriterionRenderer.Builder()
@@ -43,7 +43,7 @@ protected AbstractBooleanExpressionRenderer(AbstractBuilder<M, ?> builder) {
4343
.withParameterName(builder.parameterName)
4444
.build();
4545

46-
prefix = Objects.requireNonNull(builder.prefix);
46+
this.prefix = Objects.requireNonNull(prefix);
4747
}
4848

4949
public Optional<FragmentAndParameters> render() {
@@ -92,10 +92,7 @@ public abstract static class AbstractBuilder<M, B extends AbstractBuilder<M, B>>
9292
private AtomicInteger sequence;
9393
private String parameterName;
9494

95-
private final String prefix;
96-
97-
protected AbstractBuilder(String prefix, M model) {
98-
this.prefix = prefix;
95+
protected AbstractBuilder(M model) {
9996
this.model = model;
10097
}
10198

src/main/java/org/mybatis/dynamic/sql/select/render/HavingRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
public class HavingRenderer extends AbstractBooleanExpressionRenderer<HavingModel> {
2222
private HavingRenderer(Builder builder) {
23-
super(builder);
23+
super("having", builder); //$NON-NLS-1$
2424
}
2525

2626
public static Builder withHavingModel(HavingModel havingModel) {
@@ -29,7 +29,7 @@ public static Builder withHavingModel(HavingModel havingModel) {
2929

3030
public static class Builder extends AbstractBuilder<HavingModel, Builder> {
3131
public Builder(HavingModel havingModel) {
32-
super("having", havingModel); //$NON-NLS-1$
32+
super(havingModel);
3333
}
3434

3535
@Override

src/main/java/org/mybatis/dynamic/sql/where/render/WhereRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
public class WhereRenderer extends AbstractBooleanExpressionRenderer<WhereModel> {
2626
private WhereRenderer(Builder builder) {
27-
super(builder);
27+
super("where", builder); //$NON-NLS-1$
2828
}
2929

3030
@Override
@@ -44,7 +44,7 @@ public static Builder withWhereModel(WhereModel whereModel) {
4444

4545
public static class Builder extends AbstractBuilder<WhereModel, Builder> {
4646
public Builder(WhereModel whereModel) {
47-
super("where", whereModel); //$NON-NLS-1$
47+
super(whereModel);
4848
}
4949

5050
@Override

0 commit comments

Comments
 (0)