C# Class Habanero.BO.TransactionalBusinessObject

Inheritance: ITransactional
ファイルを表示 Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
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.

UpdateAsRolledBack ( ) : void

updates the object as rolled back

UpdateStateAsCommitted ( ) : void

Updates the business object as committed

Protected Methods

Method Description
CanBePersisted ( string &errMsg ) : bool

Checks whether the Wrapped business object can be Persisted.

CheckCanDelete ( string &errMsg ) : bool

Checks whether the Wrapped business object can be deleted.

CheckDuplicateIdentifier ( List pendingTransactions, List errorMessages ) : void

returns true if there is already an object in the database with the same primary identifier (primary key) or with the same alternate identifier (alternate key)

CheckForConcurrencyErrors ( ) : void

Checks the underlying business object for any concurrency control errors before trying to commit to the datasource

IsNew ( ) : bool

Whether the business object's state is new

IsNewAndDeleted ( ) : bool

returns true if the underlying business object is new and deleted. I.e. it is in an invalid state which means that it has already been deleted from the database.

IsValid ( string &invalidReason ) : bool

Indicates whether all of the property values are valid

TransactionalBusinessObject ( IBusinessObject businessObject ) : System

Creates a TransactionalBusinessObject that wraps the IBusinessObject

UpdateObjectBeforePersisting ( ITransactionCommitter transactionCommitter ) : void

Executes any custom code required by the business object before it is persisted to the database. This has the additionl capability of creating or updating other business objects and adding these to the transaction committer.

Private Methods

Method Description
CheckDuplicatePrimaryKey ( BusinessObject bo, List pendingTransactions, IPrimaryKey primaryKey, List errorMessages ) : void
GetClassDisplayName ( BusinessObject bo ) : string
GetDuplicateKeyCriteria ( Criteria keyCriteria, Criteria primaryKeyCriteria ) : Criteria
GetDuplicateObjectErrMsg ( IBOKey boKey, string classDisplayName ) : string

GetDuplicateObjects ( BusinessObject bo, List pendingTransactions, Criteria keyCriteria ) : IBusinessObjectCollection

Method Details

CanBePersisted() protected method

Checks whether the Wrapped business object can be Persisted.
protected CanBePersisted ( string &errMsg ) : bool
errMsg string
return bool

CheckCanDelete() protected method

Checks whether the Wrapped business object can be deleted.
protected CheckCanDelete ( string &errMsg ) : bool
errMsg string
return bool

CheckDuplicateIdentifier() protected method

returns true if there is already an object in the database with the same primary identifier (primary key) or with the same alternate identifier (alternate key)
protected CheckDuplicateIdentifier ( List pendingTransactions, List errorMessages ) : void
pendingTransactions List
errorMessages List
return void

CheckForConcurrencyErrors() protected method

Checks the underlying business object for any concurrency control errors before trying to commit to the datasource
protected CheckForConcurrencyErrors ( ) : void
return void

IsNew() protected method

Whether the business object's state is new
protected IsNew ( ) : bool
return bool

IsNewAndDeleted() protected method

returns true if the underlying business object is new and deleted. I.e. it is in an invalid state which means that it has already been deleted from the database.
protected IsNewAndDeleted ( ) : bool
return bool

IsValid() protected method

Indicates whether all of the property values are valid
protected IsValid ( string &invalidReason ) : bool
invalidReason string A string to modify with a reason /// for any invalid values
return bool

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

TransactionalBusinessObject() protected method

Creates a TransactionalBusinessObject that wraps the IBusinessObject
protected TransactionalBusinessObject ( IBusinessObject businessObject ) : System
businessObject IBusinessObject
return System

UpdateAsRolledBack() public method

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

UpdateObjectBeforePersisting() protected method

Executes any custom code required by the business object before it is persisted to the database. This has the additionl capability of creating or updating other business objects and adding these to the transaction committer.
protected UpdateObjectBeforePersisting ( ITransactionCommitter transactionCommitter ) : void
transactionCommitter ITransactionCommitter the transaction committer that is executing the transaction
return void

UpdateStateAsCommitted() public method

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