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
Modifier and TypeClassDescriptionstatic interface
The As or Columns part of building aSQLCreateStatement
static interface
The building part of building aSQLCreateStatement
static interface
The database name part of building aSQLCreateStatement
static interface
The If Not Exists of Database name part of building aSQLCreateStatement
static interface
The If Not Exists or table name part of building aSQLCreateStatement
static interface
The Foreign Keys or Building part of building aSQLCreateStatement
static class
A builder to create aSQLCreateStatement
.static interface
The table name part of building aSQLCreateStatement
static interface
Thetype
part of building aSQLCreateStatement
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<ColumnDefinition>
Thecolumns
to create in the tableprivate final List<ForeignKeyConstraint>
Theforeign keys
to add to the tableprivate final boolean
Whether to include IF NOT EXISTS in the statement or notprivate final String
The name of the table/database to be createdprivate final SQLSelectStatement
Theselect statement
to use to grab another tableprivate final SQLType
Thetype
to be created -
Constructor Summary
ModifierConstructorDescriptionprivate
SQLCreateStatement
(SQLType type, boolean ifNotExists, String name, SQLSelectStatement selectStmt, List<ColumnDefinition> columns, List<ForeignKeyConstraint> foreignKeys) Constructs a newSQLCreateStatement
with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic SQLCreateStatement.Type
builder()
boolean
getName()
getType()
toString()
-
Field Details
-
type
Thetype
to 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 statement
to use to grab another table -
columns
Thecolumns
to create in the table -
foreignKeys
Theforeign keys
to 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 newSQLCreateStatement
with the given parameters- Parameters:
type
- Thetype
to be createdifNotExists
- Whether to include IF NOT EXISTS in the statement or notname
- The name of the table/database to be createdselectStmt
- Theselect statement
to use to grab another tablecolumns
- Thecolumns
to create in the tableforeignKeys
- Theforeign keys
to add to the table
-
-
Method Details
-
builder
- Returns:
- A new
builder
to create aSQLCreateStatement
-
getType
- Returns:
- The
type
to 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 statement
to use to grab another table
-
getColumns
- Returns:
- The
columns
to create in the table
-
getForeignKeys
- Returns:
- The
foreign keys
to add to the table
-
toString
-