Package adams.db.wrapper
Class AbstractWrapper<W extends TableInterface>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.db.wrapper.AbstractWrapper<W>
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,TableInterface
,Serializable
public abstract class AbstractWrapper<W extends TableInterface> extends LoggingObject implements TableInterface, DatabaseConnectionProvider
Ancestor for wrapper table classes.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDatabaseConnection
m_Connection
the database connection.protected String
m_TableName
the table name.protected W
m_Wrapped
the wrapped backend.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWrapper(AbstractDatabaseConnection dbcon, W wrapped)
Initializes the wrapper.protected
AbstractWrapper(AbstractDatabaseConnection dbcon, W wrapped, String tableName)
Initializes the wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractDatabaseConnection
getDatabaseConnection()
Returns the currently used database connection object, can be null.String
getTableName()
Get name of table.W
getWrapped()
Returns the wrapped backend.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Connection
protected AbstractDatabaseConnection m_Connection
the database connection.
-
m_Wrapped
protected W extends TableInterface m_Wrapped
the wrapped backend.
-
m_TableName
protected String m_TableName
the table name.
-
-
Constructor Detail
-
AbstractWrapper
protected AbstractWrapper(AbstractDatabaseConnection dbcon, W wrapped)
Initializes the wrapper.- Parameters:
dbcon
- the database connectionwrapped
- the wrapped backend
-
AbstractWrapper
protected AbstractWrapper(AbstractDatabaseConnection dbcon, W wrapped, String tableName)
Initializes the wrapper.- Parameters:
dbcon
- the database connectionwrapped
- the wrapped backend
-
-
Method Detail
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the current object
-
getTableName
public String getTableName()
Get name of table.- Specified by:
getTableName
in interfaceTableInterface
- Returns:
- table name
-
getWrapped
public W getWrapped()
Returns the wrapped backend.- Returns:
- the backend
-
-