|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.mydb.control.TableManager
public class TableManager
Manager used to create or modify a database table, not its content but its description. For the moment, only creation mode is managed.
Field Summary | |
---|---|
static int |
MODE_CREATION
|
static int |
MODE_UPDATE
|
Constructor Summary | |
---|---|
TableManager(int mode,
String originPage,
ArrayList<String> keywords,
DataTypeList dataTypeList)
|
Method Summary | |
---|---|
DataTypeList |
getDataTypeList()
|
DbColumn |
getErrorColumn()
|
String |
getErrorLabel()
|
ForeignKeys |
getForeignKeys()
|
String[] |
getForeignKeysQueries()
|
String[][] |
getKeysImpacts()
Each line of the returned table contains informations concerning a column of the table : - the name of the column - the names of the keys which would be modified if the column is removed - the names of the keys which would be removed if the column is removed |
int |
getMode()
|
String |
getOriginPage()
|
PrimaryKey |
getPrimaryKey()
|
DbTable |
getTable()
|
String |
getTableCreationQuery()
|
UnicityKeys |
getUnicityKeys()
|
String[] |
getUnicityKeysQueries()
|
boolean |
hasErrorLabel()
|
boolean |
isCreationMode()
|
boolean |
isValidColumn(DbColumn column,
com.stratelia.silverpeas.util.ResourcesWrapper resources,
int exceptedIndex)
Checks if the column is valid. |
boolean |
isValidKeyName(Object object,
com.stratelia.silverpeas.util.ResourcesWrapper resources,
int index)
Checks the validity of the object's name : - the name has to be valorized. |
boolean |
isValidTableName(String[] tableNames,
com.stratelia.silverpeas.util.ResourcesWrapper resources)
Checks if the current table's name is valid. |
void |
removeColumn(int index)
Removes from the table the column corresponding to the index. |
void |
setErrorColumn(DbColumn errorColumn)
|
void |
setErrorLabel(String errorLabel)
|
void |
updateColumn(DbColumn column,
int index)
Updates the column corresponding to the column and the index given as parameters. |
void |
updateColumn(String name,
int errorType,
String value)
Updates a column consecutively to an error detected in a foreign key which references it. |
void |
updatePrimaryKey(PrimaryKey newPrimaryKey)
Updates the primary key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODE_CREATION
public static final int MODE_UPDATE
Constructor Detail |
---|
public TableManager(int mode, String originPage, ArrayList<String> keywords, DataTypeList dataTypeList)
Method Detail |
---|
public int getMode()
public String getOriginPage()
public boolean isCreationMode()
public DbTable getTable()
public void setErrorColumn(DbColumn errorColumn)
public DbColumn getErrorColumn()
public void setErrorLabel(String errorLabel)
public String getErrorLabel()
public boolean hasErrorLabel()
public DataTypeList getDataTypeList()
public PrimaryKey getPrimaryKey()
public UnicityKeys getUnicityKeys()
public ForeignKeys getForeignKeys()
public void updatePrimaryKey(PrimaryKey newPrimaryKey)
newPrimaryKey
- The reference primary key.public void updateColumn(DbColumn column, int index)
column
- The reference column.index
- The index of the column to update.public void removeColumn(int index)
index
- The index of the column to delete.public boolean isValidTableName(String[] tableNames, com.stratelia.silverpeas.util.ResourcesWrapper resources)
tableNames
- The other tables names.resources
- The resources wrapper.
public boolean isValidColumn(DbColumn column, com.stratelia.silverpeas.util.ResourcesWrapper resources, int exceptedIndex)
column
- The column to check.resources
- The resources wrapper.exceptedIndex
- The index of the column (to avoid comparing the column with itself).
public boolean isValidKeyName(Object object, com.stratelia.silverpeas.util.ResourcesWrapper resources, int index)
object
- The object (column or key) to check.resources
- The resources wrapper.index
- The index of the object (to avoid comparing the object with itself).
public String getTableCreationQuery()
public String[] getUnicityKeysQueries()
public String[] getForeignKeysQueries()
public void updateColumn(String name, int errorType, String value)
name
- the column's name.errorType
- The error type.value
- The new value, corresponding to the new type or size of the column.public String[][] getKeysImpacts()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |