Class SQLCreateStatement
java.lang.Object
com.github.tadukoo.database.mysql.syntax.statement.SQLCreateStatement
SQLCreateStatement represents a MySQL Create statement
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe As or Columns part of building aSQLCreateStatementstatic interfaceThe building part of building aSQLCreateStatementstatic interfaceThe database name part of building aSQLCreateStatementstatic interfaceThe If Not Exists of Database name part of building aSQLCreateStatementstatic interfaceThe If Not Exists or table name part of building aSQLCreateStatementstatic interfaceThe Foreign Keys or Building part of building aSQLCreateStatementstatic classA builder to create aSQLCreateStatement.static interfaceThe table name part of building aSQLCreateStatementstatic interfaceThetypepart of building aSQLCreateStatement -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ColumnDefinition>Thecolumnsto create in the tableprivate final List<ForeignKeyConstraint>Theforeign keysto add to the tableprivate final booleanWhether to include IF NOT EXISTS in the statement or notprivate final StringThe name of the table/database to be createdprivate final SQLSelectStatementTheselect statementto use to grab another tableprivate final SQLTypeThetypeto be created -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSQLCreateStatement(SQLType type, boolean ifNotExists, String name, SQLSelectStatement selectStmt, List<ColumnDefinition> columns, List<ForeignKeyConstraint> foreignKeys) Constructs a newSQLCreateStatementwith the given parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic SQLCreateStatement.Typebuilder()booleangetName()getType()toString()
-
Field Details
-
type
Thetypeto be created -
ifNotExists
private final boolean ifNotExistsWhether to include IF NOT EXISTS in the statement or not -
name
The name of the table/database to be created -
selectStmt
Theselect statementto use to grab another table -
columns
Thecolumnsto create in the table -
foreignKeys
Theforeign keysto add to the table
-
-
Constructor Details
-
SQLCreateStatement
private SQLCreateStatement(SQLType type, boolean ifNotExists, String name, SQLSelectStatement selectStmt, List<ColumnDefinition> columns, List<ForeignKeyConstraint> foreignKeys) Constructs a newSQLCreateStatementwith the given parameters- Parameters:
type- Thetypeto be createdifNotExists- Whether to include IF NOT EXISTS in the statement or notname- The name of the table/database to be createdselectStmt- Theselect statementto use to grab another tablecolumns- Thecolumnsto create in the tableforeignKeys- Theforeign keysto add to the table
-
-
Method Details
-
builder
- Returns:
- A new
builderto create aSQLCreateStatement
-
getType
- Returns:
- The
typeto be created
-
getIfNotExists
public boolean getIfNotExists()- Returns:
- Whether to include IF NOT EXISTS in the statement or not
-
getName
- Returns:
- The name of the table/database to be created
-
getSelectStmt
- Returns:
- The
select statementto use to grab another table
-
getColumns
- Returns:
- The
columnsto create in the table
-
getForeignKeys
- Returns:
- The
foreign keysto add to the table
-
toString
-