Skip to content

Commit

Permalink
[#4050] More consistent method naming
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Feb 5, 2016
1 parent 17888d1 commit 4c1795f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 8 additions & 2 deletions jOOQ/src/main/java/org/jooq/CreateTableConstraintStep.java
Expand Up @@ -49,15 +49,21 @@
*/ */
public interface CreateTableConstraintStep extends CreateTableOnCommitStep { public interface CreateTableConstraintStep extends CreateTableOnCommitStep {


/**
* Add a constraint to the table.
*/
@Support
CreateTableConstraintStep constraint(Constraint constraint);

/** /**
* Add constraints to the table. * Add constraints to the table.
*/ */
@Support @Support
CreateTableConstraintStep constraint(Constraint... constraints); CreateTableConstraintStep constraints(Constraint... constraints);


/** /**
* Add constraints to the table. * Add constraints to the table.
*/ */
@Support @Support
CreateTableConstraintStep constraint(Collection<? extends Constraint> constraints); CreateTableConstraintStep constraints(Collection<? extends Constraint> constraints);
} }
11 changes: 8 additions & 3 deletions jOOQ/src/main/java/org/jooq/impl/CreateTableImpl.java
Expand Up @@ -162,12 +162,17 @@ public final CreateTableColumnStep column(String field, DataType<?> type) {
} }


@Override @Override
public final CreateTableConstraintStep constraint(Constraint... c) { public final CreateTableConstraintStep constraint(Constraint c) {
return constraint(Arrays.asList(c)); return constraints(Arrays.asList(c));
} }


@Override @Override
public final CreateTableConstraintStep constraint(Collection<? extends Constraint> c) { public final CreateTableConstraintStep constraints(Constraint... c) {
return constraints(Arrays.asList(c));
}

@Override
public final CreateTableConstraintStep constraints(Collection<? extends Constraint> c) {
constraints.addAll(c); constraints.addAll(c);
return this; return this;
} }
Expand Down

0 comments on commit 4c1795f

Please sign in to comment.