Package adams.db
Class LogF
-
- All Implemented Interfaces:
LoggingSupporter,SizeOfHandler,DatabaseConnectionProvider,DatabaseConnectionUser,IndexedTableInterface,LogIntf,SQLIntfAccess,TableInterface,Serializable
public class LogF extends AbstractIndexedTableFacade implements LogIntf
Facade for logging backends.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LogIntfm_DBthe backend.protected static FacadeManager<LogF>m_TableManagerthe facade manager.-
Fields inherited from class adams.db.AbstractTableFacade
m_DatabaseConnection, m_Debug, m_TableName
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.db.LogIntf
TABLE_NAME
-
-
Constructor Summary
Constructors Constructor Description LogF(AbstractDatabaseConnection dbcon)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(LogEntry log)Adds a log entry.booleanexists(LogEntry log)Looks for a log entry in the DB, looking for the auto_id.AbstractDatabaseQueriesgetQueries()Returns the underlying queries helper instance.static LogFgetSingleton(AbstractDatabaseConnection dbcon)Returns the singleton of the facade.SQLIntfgetSQLIntf()Returns the underlyingSQLIntfinstance.booleanhasSQLIntf()Returns whether aSQLIntfinstance is available.LogEntryload(long auto_id)Loads a log entry from db, using the database ID.List<LogEntry>load(LogEntryConditions cond)Loads log entries from the database that match the conditions.StringquoteName(String name)Returns the column/table quoted if ANSI quotes are to be used.booleanremove(LogEntry log)Removes a log entry from the DB.booleanupdate(LogEntry log)Updates a log entry.booleanuseAnsiQuotes()Returns whether ANSI quotes are to be used around table/column names.-
Methods inherited from class adams.db.AbstractTableFacade
getDatabaseConnection, getDebug, getTableName, reload, setDebug, updatePrefix
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface adams.db.TableInterface
getTableName
-
-
-
-
Field Detail
-
m_TableManager
protected static FacadeManager<LogF> m_TableManager
the facade manager.
-
m_DB
protected LogIntf m_DB
the backend.
-
-
Constructor Detail
-
LogF
public LogF(AbstractDatabaseConnection dbcon)
Constructor.- Parameters:
dbcon- the database context to use
-
-
Method Detail
-
load
public LogEntry load(long auto_id)
Loads a log entry from db, using the database ID.
-
load
public List<LogEntry> load(LogEntryConditions cond)
Loads log entries from the database that match the conditions.
-
exists
public boolean exists(LogEntry log)
Looks for a log entry in the DB, looking for the auto_id.
-
add
public boolean add(LogEntry log)
Adds a log entry.
-
update
public boolean update(LogEntry log)
Updates a log entry.
-
remove
public boolean remove(LogEntry log)
Removes a log entry from the DB.
-
hasSQLIntf
public boolean hasSQLIntf()
Returns whether aSQLIntfinstance is available.- Specified by:
hasSQLIntfin interfaceSQLIntfAccess- Returns:
- true if available
-
getSQLIntf
public SQLIntf getSQLIntf()
Returns the underlyingSQLIntfinstance.- Specified by:
getSQLIntfin interfaceSQLIntfAccess- Returns:
- the instance, null if if unavailable
-
useAnsiQuotes
public boolean useAnsiQuotes()
Returns whether ANSI quotes are to be used around table/column names.- Specified by:
useAnsiQuotesin interfaceIndexedTableInterface- Returns:
- true if to be used
-
quoteName
public String quoteName(String name)
Returns the column/table quoted if ANSI quotes are to be used.- Specified by:
quoteNamein interfaceIndexedTableInterface- Parameters:
name- the table/column name to quote (if necessary)- Returns:
- the potentially quoted name
- See Also:
useAnsiQuotes()
-
getQueries
public AbstractDatabaseQueries getQueries()
Returns the underlying queries helper instance.- Specified by:
getQueriesin interfaceIndexedTableInterface- Returns:
- the instance, null if not available
-
getSingleton
public static LogF getSingleton(AbstractDatabaseConnection dbcon)
Returns the singleton of the facade.- Parameters:
dbcon- the database connection to get the singleton for- Returns:
- the singleton
-
-