Package net.sf.basedb.core.log.db
Class DbLogManager
java.lang.Object
net.sf.basedb.core.log.db.DbLogManager
- All Implemented Interfaces:
LogManager
public class DbLogManager extends Object implements LogManager
Log manager implementation that logs changes to the database.
- Version:
- 2.13
- Author:
- Nicklas
- Last modified
- $Date: 2013-11-22 10:36:49 +0100 (fr, 22 nov 2013) $
-
Field Summary
Fields Modifier and Type Field Description private ChangeHistoryData
history
private LogControl
logControl
-
Constructor Summary
Constructors Constructor Description DbLogManager(LogControl logControl)
-
Method Summary
Modifier and Type Method Description void
afterCommit()
Called after a successful commit of changes to the database.void
afterRollback()
Called after rollback.private void
createHistory()
LogControl
getLogControl()
Get the log controller that is used in this transaction.void
logChangeDetails(Collection<ChangeHistoryDetailData> changeDetails, EntityDetails entityDetails)
Log the given details to the database.void
logChangeDetails(ChangeHistoryDetailData changeDetails, EntityDetails entityDetails)
Log the given details to the database.
-
Field Details
-
logControl
-
history
-
-
Constructor Details
-
DbLogManager
-
-
Method Details
-
afterCommit
public void afterCommit()Description copied from interface:LogManager
Called after a successful commit of changes to the database. Note that this method is not called until after the changes have been written to the database and the connection has been closed. If the log manager wants to add information to the database, it must be done before this method is called.- Specified by:
afterCommit
in interfaceLogManager
-
afterRollback
public void afterRollback()Description copied from interface:LogManager
Called after rollback. Note that this methd is not called until after the connection to the database has been closed, and that any information that the log manager has added to the database have also been rolled back.- Specified by:
afterRollback
in interfaceLogManager
-
getLogControl
Description copied from interface:LogManager
Get the log controller that is used in this transaction.- Specified by:
getLogControl
in interfaceLogManager
-
logChangeDetails
Log the given details to the database. TheChangeHistoryDetailData.setChangeHistory(ChangeHistoryData)
is automatically populated (and saved if needed) with information from the current transaction. -
logChangeDetails
public void logChangeDetails(Collection<ChangeHistoryDetailData> changeDetails, EntityDetails entityDetails)Log the given details to the database. TheChangeHistoryDetailData.setChangeHistory(ChangeHistoryData)
is automatically populated (and saved if needed) with information from the current transaction.- Since:
- 3.3
-
createHistory
private void createHistory()
-