Package rife.database.queries
Class CreateTable
java.lang.Object
rife.database.queries.CreateTable
Object representation of a SQL "CREATE TABLE" query.
This object may be used to dynamically construct a SQL statement in a
database-independent fashion. After it is finished, it may be executed using
DbQueryManager.executeUpdate()
.
- Since:
- 1.0
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
class
class
class
static class
class
class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CreateTable.ViolationAction
protected Datasource
protected boolean
static final CreateTable.ViolationAction
static final CreateTable.Nullable
static final CreateTable.Nullable
static final CreateTable.ViolationAction
static final CreateTable.ViolationAction
static final CreateTable.ViolationAction
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected void
clone()
column
(String name, Class type, int precision, int scale, String typeAttribute, CreateTable.Nullable nullable) column
(String name, Class type, int precision, int scale, CreateTable.Nullable nullable) column
(String name, Class type, int precision, String typeAttribute, CreateTable.Nullable nullable) column
(String name, Class type, int precision, CreateTable.Nullable nullable) column
(String name, Class type, String typeAttribute, CreateTable.Nullable nullable) column
(String name, Class type, CreateTable.Nullable nullable) column
(String name, String customType, CreateTable.Nullable nullable) columnsExcluded
(Class beanClass, String[] excludedFields) columnsFiltered
(Class beanClass, String[] includedFields, String[] excludedFields) columnsIncluded
(Class beanClass, String[] includedFields) customAttribute
(String name, String attribute) defaultFunction
(String name, String defaultFunction) defaultValue
(String name, boolean value) defaultValue
(String name, Object value) foreignKey
(String foreignTable, String[] columnsMapping) foreignKey
(String foreignTable, String[] columnsMapping, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) foreignKey
(String foreignTable, String localColumn, String foreignColumn) foreignKey
(String name, String foreignTable, String[] columnsMapping) foreignKey
(String name, String foreignTable, String[] columnsMapping, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) foreignKey
(String name, String foreignTable, String localColumn, String foreignColumn) foreignKey
(String name, String foreignTable, String localColumn, String foreignColumn, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) foreignKey
(String foreignTable, String localColumn, String foreignColumn, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) rife.database.capabilities.Capabilities
getSql()
getTable()
boolean
nullable
(String name, CreateTable.Nullable nullable) primaryKey
(String column) primaryKey
(String[] columns) primaryKey
(String name, String column) primaryKey
(String name, String[] columns) void
setExcludeUnsupportedCapabilities
(boolean flag) temporary
(boolean temporary) toString()
-
Field Details
-
NULL
-
NOTNULL
-
NOACTION
-
RESTRICT
-
CASCADE
-
SETNULL
-
SETDEFAULT
-
datasource_
-
sql_
-
excludeUnsupportedCapabilities_
protected boolean excludeUnsupportedCapabilities_
-
-
Constructor Details
-
CreateTable
-
-
Method Details
-
clear
public void clear() -
getCapabilities
public rife.database.capabilities.Capabilities getCapabilities()- Specified by:
getCapabilities
in interfaceQuery
-
getTable
-
isTemporary
public boolean isTemporary() -
getColumnMapping
-
getPrimaryKeys
-
getForeignKeys
-
getUniqueConstraints
-
getCheckConstraints
-
getSql
- Specified by:
getSql
in interfaceQuery
- Throws:
DbQueryException
-
table
-
temporary
-
column
-
column
-
column
-
column
-
column
-
column
-
column
-
column
public CreateTable column(String name, Class type, String typeAttribute, CreateTable.Nullable nullable) -
column
-
column
public CreateTable column(String name, Class type, int precision, String typeAttribute, CreateTable.Nullable nullable) -
column
public CreateTable column(String name, Class type, int precision, int scale, CreateTable.Nullable nullable) -
column
public CreateTable column(String name, Class type, int precision, int scale, String typeAttribute, CreateTable.Nullable nullable) -
column
-
column
-
columns
-
precision
-
precision
-
nullable
-
defaultValue
-
defaultValue
-
defaultFunction
-
customAttribute
-
columns
- Throws:
DbQueryException
-
columnsIncluded
public CreateTable columnsIncluded(Class beanClass, String[] includedFields) throws DbQueryException - Throws:
DbQueryException
-
columnsExcluded
public CreateTable columnsExcluded(Class beanClass, String[] excludedFields) throws DbQueryException - Throws:
DbQueryException
-
columnsFiltered
public CreateTable columnsFiltered(Class beanClass, String[] includedFields, String[] excludedFields) throws DbQueryException - Throws:
DbQueryException
-
-
primaryKey
-
primaryKey
-
primaryKey
-
foreignKey
-
foreignKey
public CreateTable foreignKey(String foreignTable, String localColumn, String foreignColumn, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) -
foreignKey
-
foreignKey
public CreateTable foreignKey(String foreignTable, String[] columnsMapping, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) -
foreignKey
public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn) -
foreignKey
public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) -
foreignKey
-
foreignKey
public CreateTable foreignKey(String name, String foreignTable, String[] columnsMapping, CreateTable.ViolationAction onUpdate, CreateTable.ViolationAction onDelete) -
unique
-
unique
-
unique
-
unique
-
check
-
check
-
clone
-
getDatasource
-
getParameters
- Specified by:
getParameters
in interfaceQuery
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilities
in interfaceQuery
-
clearGenerated
protected void clearGenerated() -
toString
-