public class DbModifier
extends java.lang.Object
DataObject
Modifier and Type | Field and Description |
---|---|
static int |
MODIFY_CREATE |
static int |
MODIFY_DELETE |
static int |
MODIFY_UPDATE |
Constructor and Description |
---|
DbModifier() |
Modifier and Type | Method and Description |
---|---|
boolean |
createTable(java.sql.Connection dbConnection,
EntityInfo entityInfo) |
boolean |
createTable(java.sql.Connection dbConnection,
java.lang.String tableName,
AbstractAttribute[] attributes,
Index[] indices,
ForeignKey[] foreignKeys) |
static boolean |
deleteTable(java.sql.Connection dbConnection,
java.lang.String tableName)
Drops a table.
|
boolean |
dropTable(java.sql.Connection dbConnection,
java.lang.String tableName,
Index[] indices)
Drop table.
|
static java.lang.String |
getCreateIndexStatement(Index index,
java.lang.String tableName,
int nbr) |
static java.lang.String |
getCreateStatement(int databaseType,
EntityInfo entityInfo) |
static java.lang.String |
getCreateStatement(int databaseType,
java.lang.String tableName,
AbstractAttribute[] attributes,
Index[] indices,
ForeignKey[] foreignKeys) |
static SqlDialect |
getSqlDialect(int databaseType) |
int |
getStartIndexForSeperateIndices(java.sql.Connection connection)
Returns the start index for indices to build in addition to the primary key.
|
int |
getStartIndexForSeperateIndices(int databaseType) |
void |
setDropBeforeCreation(boolean newDropBeforeCreation) |
boolean |
supportsPrimaryKey(int databaseType) |
boolean |
updateTable(ConnectionSpecification connSpec,
EntityInfo entityInfo)
Updates a tables structure without loosing its data content.
|
boolean |
updateTable(ConnectionSpecification connSpec,
java.lang.String tableName,
AbstractAttribute[] attributes,
Index[] indices,
ForeignKey[] foreignKeys) |
public static final int MODIFY_CREATE
public static final int MODIFY_UPDATE
public static final int MODIFY_DELETE
public void setDropBeforeCreation(boolean newDropBeforeCreation)
public boolean dropTable(java.sql.Connection dbConnection, java.lang.String tableName, Index[] indices)
dbConnection
- the database connection to usetableName
- the table nameindices
- the indices of the tablepublic boolean createTable(java.sql.Connection dbConnection, EntityInfo entityInfo)
public boolean createTable(java.sql.Connection dbConnection, java.lang.String tableName, AbstractAttribute[] attributes, Index[] indices, ForeignKey[] foreignKeys)
dbConnection
- the database connection to usetableName
- the table nameattributes
- the attributes of the tableindices
- the indices of the tablepublic int getStartIndexForSeperateIndices(java.sql.Connection connection)
connection
- the connection to identify the database typepublic int getStartIndexForSeperateIndices(int databaseType)
public boolean supportsPrimaryKey(int databaseType)
public static java.lang.String getCreateIndexStatement(Index index, java.lang.String tableName, int nbr)
public boolean updateTable(ConnectionSpecification connSpec, EntityInfo entityInfo)
dbConnection
- the database connection to usetableName
- the table nameattributes
- the attributes of the tableindices
- the indices of the tablepublic boolean updateTable(ConnectionSpecification connSpec, java.lang.String tableName, AbstractAttribute[] attributes, Index[] indices, ForeignKey[] foreignKeys)
public static java.lang.String getCreateStatement(int databaseType, EntityInfo entityInfo)
public static java.lang.String getCreateStatement(int databaseType, java.lang.String tableName, AbstractAttribute[] attributes, Index[] indices, ForeignKey[] foreignKeys)
public static SqlDialect getSqlDialect(int databaseType)
public static boolean deleteTable(java.sql.Connection dbConnection, java.lang.String tableName)
dbConnection
- the database connection to usetableName
- the table nameCopyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de