Package adams.db
Class AbstractTableFacade
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.db.AbstractTableFacade
-
- All Implemented Interfaces:
LoggingSupporter,SizeOfHandler,Serializable
public abstract class AbstractTableFacade extends LoggingObject
Ancestor for database table facades.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDatabaseConnectionm_DatabaseConnectionconnection to database.protected booleanm_Debugwhether debugging is turned on.protected Stringm_TableNamename of the table.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractTableFacade(AbstractDatabaseConnection dbcon, String tableName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractDatabaseConnectiongetDatabaseConnection()Returns the database connection this table is for.booleangetDebug()Returns whether debugging is enabled.StringgetTableName()Get name of table.voidreload()Reloads the data, if necessary.voidsetDebug(boolean value)Sets whether debugging is enabled, outputs more on the console.protected voidupdatePrefix()Updates the prefix of the console object output streams.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_TableName
protected String m_TableName
name of the table.
-
m_Debug
protected boolean m_Debug
whether debugging is turned on.
-
m_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
connection to database.
-
-
Constructor Detail
-
AbstractTableFacade
public AbstractTableFacade(AbstractDatabaseConnection dbcon, String tableName)
Constructor.- Parameters:
dbcon- the database context to usetableName- the name of the table
-
-
Method Detail
-
updatePrefix
protected void updatePrefix()
Updates the prefix of the console object output streams.
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the database connection this table is for.- Returns:
- the database connection
-
getTableName
public String getTableName()
Get name of table.- Returns:
- table name
-
setDebug
public void setDebug(boolean value)
Sets whether debugging is enabled, outputs more on the console.- Parameters:
value- if true debugging is enabled
-
getDebug
public boolean getDebug()
Returns whether debugging is enabled.- Returns:
- true if debugging is enabled
-
reload
public void reload()
Reloads the data, if necessary.
Default implementation does nothing.
-
-