Skip to content

Commit 1d0c753

Browse files
Added NULL flag for table columns
1 parent 6530924 commit 1d0c753

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/net/escosoft/mysqlwrapper/table/TableColumn.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public final class TableColumn {
1212
private final TableType type;
1313

1414
private String[] typeData;
15-
private boolean notNull;
15+
private boolean Null, notNull;
1616
private String defaultValue;
1717

1818
private TableColumn(String name, TableType type) {
@@ -38,6 +38,9 @@ public String create() {
3838
.append(joiner)
3939
.append(")");
4040
}
41+
if (this.Null) {
42+
builder.append(" NULL");
43+
}
4144
if (this.notNull) {
4245
builder.append(" NOT NULL");
4346
}
@@ -65,6 +68,14 @@ public Builder typeData(String... typeData) {
6568
return this;
6669
}
6770

71+
/**
72+
* Adds NULL string to current column building-up.
73+
*/
74+
public Builder Null() {
75+
this.column.Null = true;
76+
return this;
77+
}
78+
6879
/**
6980
* Adds NOT NULL string to current column building-up.
7081
*/

0 commit comments

Comments
 (0)