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
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassstatic classclassclassstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CreateTable.ViolationActionprotected Datasourceprotected booleanstatic final CreateTable.ViolationActionstatic final CreateTable.Nullablestatic final CreateTable.Nullablestatic final CreateTable.ViolationActionstatic final CreateTable.ViolationActionstatic final CreateTable.ViolationActionprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected voidclone()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.CapabilitiesgetSql()getTable()booleannullable(String name, CreateTable.Nullable nullable) primaryKey(String column) primaryKey(String[] columns) primaryKey(String name, String column) primaryKey(String name, String[] columns) voidsetExcludeUnsupportedCapabilities(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:
getCapabilitiesin interfaceQuery
-
getTable
-
isTemporary
public boolean isTemporary() -
getColumnMapping
-
getPrimaryKeys
-
getForeignKeys
-
getUniqueConstraints
-
getCheckConstraints
-
getSql
- Specified by:
getSqlin 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:
getParametersin interfaceQuery
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilitiesin interfaceQuery
-
clearGenerated
protected void clearGenerated() -
toString
-