|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.brains2b.sql.meta.IndexModel org.brains2b.squeler.ddl.IndexDDL
public class IndexDDL
Holds the data and creates an index for the defined values
Field Summary |
---|
Fields inherited from interface org.brains2b.squeler.ddl.DDLWriter |
---|
CONSTRAINT, INDEX, TABLE |
Fields inherited from interface org.brains2b.squeler.ddl.DDLDefinition |
---|
CREATE, DELETE, UPDATE |
Constructor Summary | |
---|---|
IndexDDL()
Constructor for IndexDDL. |
|
IndexDDL(java.lang.String indexName,
java.lang.String tableName,
boolean unique)
Method IndexDDL. |
Method Summary | |
---|---|
void |
addColumn(ColumnDDL column)
adds a Column to the Index |
int |
getAction()
|
java.lang.StringBuffer |
getStatement()
gets a StringBuffer containing the proper statement for creation |
java.lang.String |
getTablespace()
|
boolean |
isDropWithTable()
|
boolean |
isQualified()
|
boolean |
isReplaceable()
|
void |
setAction(int action)
|
void |
setColumns(java.util.List columns)
|
void |
setDropWithTable(boolean dropWithTable)
|
void |
setModel(org.brains2b.sql.meta.SQLMetaModel model)
|
void |
setTablespace(java.lang.String tablespace)
|
void |
setUnique(boolean unique)
|
java.lang.String |
toString()
|
void |
write(java.sql.Connection con)
writes the DDL statement directly to the database. |
void |
write(java.io.PrintWriter writer)
Method write. |
Methods inherited from class org.brains2b.sql.meta.IndexModel |
---|
addColumn, equals, getColumns, getName, getRecord, getTableName, getType, isUnique, setRecord |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.brains2b.sql.meta.SQLMetaModel |
---|
getName, getRecord, getType |
Methods inherited from interface org.brains2b.squeler.ddl.ColumnRelation |
---|
getColumns |
Constructor Detail |
---|
public IndexDDL()
public IndexDDL(java.lang.String indexName, java.lang.String tableName, boolean unique)
indexName
- String, the name of the index needs to be unique for the schema or catalogtableName
- String, the name of the table this index is created on.unique
- boolean, true if you want to create a unique indexMethod Detail |
---|
public java.lang.StringBuffer getStatement() throws SquelerDDLException
DDLWriter
getStatement
in interface DDLDefinition
getStatement
in interface DDLWriter
SquelerDDLException
- thrown if problems arise with the definition
of the statementDDLWriter.getStatement()
public void addColumn(ColumnDDL column)
At least one column is required, but you can add as many as the database supports. The columns will be defined in the index in the order which you add them
Note:If the column has a table defined and it is not the same as the table for this index getStatement will throw a SquelerException.
addColumn
in interface ColumnRelation
column
- ColumnDDL, the column on which this index should be created.ColumnDDL
public void write(java.io.PrintWriter writer) throws SquelerDDLException, java.io.IOException
DDLWriter
write
in interface DDLWriter
SquelerDDLException
- thrown if problems arise with the definition
of the statement
java.io.IOException
- thrown if problems arise writing a correct statement
to a file (access denied, could not create file e.d.)public void write(java.sql.Connection con) throws SquelerDDLException, java.sql.SQLException
DDLWriter
write
in interface DDLWriter
con
- java.sql.Connection, the connection to the database,
should have been initialized
SquelerDDLException
- thrown if problems arise with the definition
of the statement
java.sql.SQLException
- thrown if problems arise writing a correct statement
to the database (no privleges to run this action, e.d.)public java.lang.String toString()
toString
in interface DDLDefinition
toString
in class java.lang.Object
public int getAction()
getAction
in interface DDLDefinition
public boolean isQualified()
isQualified
in interface DDLDefinition
public boolean isReplaceable()
isReplaceable
in interface DDLDefinition
public void setAction(int action)
setAction
in interface DDLDefinition
public void setModel(org.brains2b.sql.meta.SQLMetaModel model)
setModel
in interface DDLDefinition
public void setColumns(java.util.List columns)
setColumns
in interface ColumnRelation
setColumns
in class org.brains2b.sql.meta.IndexModel
public java.lang.String getTablespace()
public void setTablespace(java.lang.String tablespace)
public boolean isDropWithTable()
public void setDropWithTable(boolean dropWithTable)
public void setUnique(boolean unique)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |