C# Class Habanero.DB.TransactionLogTable

Logs transactions in the same database that is used to store the business objects. Used to log every change to the business object. Stores datetime action carried out actionstype (CRUD). windows user, logged user. Database Field name and the dirty XML field (shows the previously persisted state and newly persisted state of the field.
Inheritance: ITransactionLog
Mostrar archivo Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
GetPersistSql ( ) : IEnumerable

Returns the appropriate sql statement collection depending on the state of the object. E.g. Update SQL, InsertSQL or DeleteSQL.

TransactionID ( ) : string

This is the ID that uniquely identifies this item of the transaction. This must be the same for the lifetime of the transaction object. This assumption is relied upon for certain optimisations in the Transaction Comitter.

TransactionLogTable ( BusinessObject busObjToLog ) : System

Constructs the new transactionlogTable with default table name and logging fields.

TransactionLogTable ( BusinessObject busObjToLog, ISecurityController securityController ) : System

Constructs the new transactionlogTable with default table name and logging fields and a specific security controller for getting the currently logged on user.

TransactionLogTable ( BusinessObject busObjToLog, ISecurityController securityController, string transactionLogTable ) : System

Constructs the new transactionlogTable with default table name and logging fields and a specific security controller for getting the currently logged on user.

TransactionLogTable ( BusinessObject busObjToLog, string transactionLogTable ) : System

Constructs the new transactionlogTable with specified table name and the defaultlogging fields.

TransactionLogTable ( BusinessObject buObjToLog, string transactionLogTable, string dateTimeUpdatedFieldName, string windowsUserFieldName, string logonUserFieldName, string businessObjectToStringFieldName, string machineUpdateName, string businessObjectTypeNameFieldName, string crudActionFieldName, string dirtyXMLFieldName ) : System

Constructor to initialise a new log table

TransactionLogTable ( BusinessObject buObjToLog, string transactionLogTable, string dateTimeUpdatedFieldName, string windowsUserFieldName, string logonUserFieldName, string businessObjectToStringFieldName, string machineUpdateName, string businessObjectTypeNameFieldName, string crudActionFieldName, string dirtyXMLFieldName, ISecurityController securityController ) : System

Constructor to initialise a new log table

UpdateAsRolledBack ( ) : void

updates the object as rolled back

UpdateStateAsCommitted ( ) : void

Updates the business object as committed

Private Methods

Method Description
GetCrudAction ( IBusinessObject busObj ) : string

Returns the status of the business object specified, such as "Created", "Deleted" or "Updated" (if dirty)

GetLogonUserName ( ) : string

Method Details

GetPersistSql() public method

Returns the appropriate sql statement collection depending on the state of the object. E.g. Update SQL, InsertSQL or DeleteSQL.
public GetPersistSql ( ) : IEnumerable
return IEnumerable

TransactionID() public method

This is the ID that uniquely identifies this item of the transaction. This must be the same for the lifetime of the transaction object. This assumption is relied upon for certain optimisations in the Transaction Comitter.
public TransactionID ( ) : string
return string

TransactionLogTable() public method

Constructs the new transactionlogTable with default table name and logging fields.
public TransactionLogTable ( BusinessObject busObjToLog ) : System
busObjToLog BusinessObject
return System

TransactionLogTable() public method

Constructs the new transactionlogTable with default table name and logging fields and a specific security controller for getting the currently logged on user.
public TransactionLogTable ( BusinessObject busObjToLog, ISecurityController securityController ) : System
busObjToLog BusinessObject
securityController ISecurityController
return System

TransactionLogTable() public method

Constructs the new transactionlogTable with default table name and logging fields and a specific security controller for getting the currently logged on user.
public TransactionLogTable ( BusinessObject busObjToLog, ISecurityController securityController, string transactionLogTable ) : System
busObjToLog BusinessObject
securityController ISecurityController
transactionLogTable string
return System

TransactionLogTable() public method

Constructs the new transactionlogTable with specified table name and the defaultlogging fields.
public TransactionLogTable ( BusinessObject busObjToLog, string transactionLogTable ) : System
busObjToLog BusinessObject the business object for which the transaction log is being created
transactionLogTable string The log table name
return System

TransactionLogTable() public method

Constructor to initialise a new log table
public TransactionLogTable ( BusinessObject buObjToLog, string transactionLogTable, string dateTimeUpdatedFieldName, string windowsUserFieldName, string logonUserFieldName, string businessObjectToStringFieldName, string machineUpdateName, string businessObjectTypeNameFieldName, string crudActionFieldName, string dirtyXMLFieldName ) : System
buObjToLog BusinessObject the business object for which the transaction log is being created
transactionLogTable string The log table name
dateTimeUpdatedFieldName string Time updated field name
windowsUserFieldName string Windows user field name
logonUserFieldName string Logon user field name
businessObjectToStringFieldName string BusinessObject ToString field name
machineUpdateName string Machine update name
businessObjectTypeNameFieldName string BO type field name
crudActionFieldName string Crud action field name
dirtyXMLFieldName string Dirty xml field name
return System

TransactionLogTable() public method

Constructor to initialise a new log table
public TransactionLogTable ( BusinessObject buObjToLog, string transactionLogTable, string dateTimeUpdatedFieldName, string windowsUserFieldName, string logonUserFieldName, string businessObjectToStringFieldName, string machineUpdateName, string businessObjectTypeNameFieldName, string crudActionFieldName, string dirtyXMLFieldName, ISecurityController securityController ) : System
buObjToLog BusinessObject the business object for which the transaction log is being created
transactionLogTable string The log table name
dateTimeUpdatedFieldName string Time updated field name
windowsUserFieldName string Windows user field name
logonUserFieldName string Logon user field name
businessObjectToStringFieldName string
machineUpdateName string Machine update name
businessObjectTypeNameFieldName string BO type field name
crudActionFieldName string Crud action field name
dirtyXMLFieldName string Dirty xml field name
securityController ISecurityController
return System

UpdateAsRolledBack() public method

updates the object as rolled back
public UpdateAsRolledBack ( ) : void
return void

UpdateStateAsCommitted() public method

Updates the business object as committed
public UpdateStateAsCommitted ( ) : void
return void