Integrated the CustomTableFieldManager into the SQLTable

This commit is contained in:
2021-08-20 14:42:37 +02:00
parent 7925f2f1af
commit 2be583685f

View File

@ -1,10 +1,7 @@
package de.gnmyt.SQLToolkit.storage; package de.gnmyt.SQLToolkit.storage;
import de.gnmyt.SQLToolkit.drivers.MySQLConnection; import de.gnmyt.SQLToolkit.drivers.MySQLConnection;
import de.gnmyt.SQLToolkit.manager.DeletionManager; import de.gnmyt.SQLToolkit.manager.*;
import de.gnmyt.SQLToolkit.manager.InsertManager;
import de.gnmyt.SQLToolkit.manager.SelectionManager;
import de.gnmyt.SQLToolkit.manager.UpdateManager;
import de.gnmyt.SQLToolkit.types.SQLType; import de.gnmyt.SQLToolkit.types.SQLType;
import de.gnmyt.SQLToolkit.types.TableField; import de.gnmyt.SQLToolkit.types.TableField;
@ -102,6 +99,34 @@ public abstract class SQLTable {
custom(new TableField(name, type, length, allowNull, defaultValue).setExtra(extras)); custom(new TableField(name, type, length, allowNull, defaultValue).setExtra(extras));
} }
/**
* Adds a table field to the table
*
* @param tableField The table field you want to add
*/
public void custom(TableField tableField) {
tableFields.add(tableField);
}
/**
* Adds a custom table field to the table
*
* @param name The name of the column
* @return the manager of the table field
*/
protected CustomTableFieldManager custom(String name) {
return new CustomTableFieldManager(this).name(name);
}
/**
* Adds a custom table field to the table
*
* @return the manager of the table field
*/
protected CustomTableFieldManager custom() {
return new CustomTableFieldManager(this);
}
/** /**
* Gets the database selection from the current the table * Gets the database selection from the current the table
* *
@ -138,15 +163,6 @@ public abstract class SQLTable {
return connection.deleteFrom(tableName()); return connection.deleteFrom(tableName());
} }
/**
* Adds a table field to the table
*
* @param tableField The table field you want to add
*/
protected void custom(TableField tableField) {
tableFields.add(tableField);
}
/** /**
* Generates the table sql * Generates the table sql
* *