public abstract class TableCreatorStd
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected DbModifier |
dbModifier |
static int |
STATE_FULL_HAPPY |
static int |
STATE_HAPPY_MINUS_UPDATE |
static int |
STATE_UNHAPPY |
static int |
TODO_ALTER |
static int |
TODO_CREATE |
static int |
TODO_UPDATE_STRUCTURE_FOR_ALL_TABLES |
static int |
UPDATE_NONE |
Constructor and Description |
---|
TableCreatorStd(GlobalStd global)
Constructs a new table creator.
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector<java.lang.String> |
alterTables(int alterationLevel)
Performs table alteration depending on alteration level
which for his part depends on the age of the database structure.
|
protected void |
createTable(DataObject dataObject) |
boolean |
createTables()
Creates all tables as specified by
getAllEntityInfos() |
int |
determineTodo()
Returns what to do with the database structure.
|
protected abstract EntityInfo[] |
getAllEntityInfos()
Returns entity info of all tables needed to execute the application.
|
abstract java.lang.String |
getDatabaseName()
Returns the database name.
|
int |
getHappyState()
Returns how happy the table creator is in detail.
|
abstract int |
getUpdateLevel()
Returns the alteration level depending on the age of the database structure.
|
protected void |
inform(java.lang.String info)
Sends progress information to the previously specified message receiver.
|
abstract boolean |
isCreationNecessary()
Returns true if table creation is necessary.
|
boolean |
isEmpty()
Returns true if database is empty (number of tables = 0).
|
boolean |
isStandardDatabase()
Returns true if the used database name is the standard name.
|
void |
setHappyState(int happyState) |
void |
setMessageReceiver(MessageReceiver messageReceiver)
Sets the receiver of progress information send later by
inform(String) |
protected void |
tablesCreated()
Event tables created for additional actions like inserting data.
|
protected abstract void |
updateDatabase(int alterationLevel)
Alter tables.
|
java.util.Vector<java.lang.String> |
updateStructureOfAllTables()
Updates all tables - special case!
|
protected void |
updateTable(DataObject dataObject) |
public static final int UPDATE_NONE
public static final int TODO_UPDATE_STRUCTURE_FOR_ALL_TABLES
public static final int TODO_ALTER
public static final int TODO_CREATE
public static final int STATE_UNHAPPY
public static final int STATE_HAPPY_MINUS_UPDATE
public static final int STATE_FULL_HAPPY
protected DbModifier dbModifier
public TableCreatorStd(GlobalStd global)
public void setMessageReceiver(MessageReceiver messageReceiver)
inform(String)
messageReceiver
- the receiver of progress informationpublic int determineTodo()
TODO_CREATE
,
UPDATE_NONE
public boolean createTables()
getAllEntityInfos()
public java.util.Vector<java.lang.String> updateStructureOfAllTables()
protected abstract EntityInfo[] getAllEntityInfos()
public abstract java.lang.String getDatabaseName()
public abstract boolean isCreationNecessary()
public boolean isStandardDatabase()
public boolean isEmpty()
public java.util.Vector<java.lang.String> alterTables(int alterationLevel)
alterationLevel
- the alteration levelpublic abstract int getUpdateLevel()
if there is nothing to alter
protected abstract void updateDatabase(int alterationLevel)
dbModifier
- the database modifier to usealterationLevel
- the alteration levelprotected void tablesCreated()
protected void createTable(DataObject dataObject)
protected void updateTable(DataObject dataObject)
protected void inform(java.lang.String info)
info
- the current progress informationpublic void setHappyState(int happyState)
public int getHappyState()
STATE_FULL_HAPPY
,
STATE_HAPPY_MINUS_UPDATE
,
STATE_UNHAPPY
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de