Definition at line 62 of file contract-gw.h.
typedef std::set<ContractId> OSB_DB::ContractGw::ContractIds |
typedef std::map<ContractId, OSB_LIB::Contract> OSB_DB::ContractGw::ContractList |
OSB_DB::ContractGw::ContractGw | ( | const ContractGw & | rhs | ) | [private] |
Prevent copying: not implemented.
OSB_DB::ContractGw::ContractGw | ( | ) | [inline] |
Definition at line 80 of file contract-gw.h.
bool OSB_DB::ContractGw::delContract | ( | const Session & | session, | |
const OSB_LIB::Contract & | co | |||
) | [private] |
Delete a contract from database.
The contract to be deleted must already exist in the database. Besides that, the object version of the contract object to be deleted must match the object version in the database. This is to ensure that the object to be deleted truly represents the entry in the databse.
session | Database session. | |
co | contract object to be deleted. |
OsbException | for the following errors:
|
long OSB_DB::ContractGw::fetch | ( | const Session & | session, | |
const OSB_LIB::Associate::Oid & | asId, | |||
ContractIds & | idList | |||
) |
Load all contract ids for an associate.
session | Database session to use. | |
asId | Object id of associate. | |
idList | Ref of list of contract ids. |
long OSB_DB::ContractGw::fetch | ( | const Session & | session, | |
const OSB_LIB::Associate::Oid & | asId, | |||
ContractList & | dest | |||
) |
Load all contracts for an associate.
It will also fetch all pers products and pers nodes for each contract.
session | Database session to use. | |
asId | Object id of associate. | |
dest | List of contract to populate |
OsbException | in case of an illegal effective or preferred status of the contract in the database. |
bool OSB_DB::ContractGw::fetch | ( | const Session & | session, | |
OSB_LIB::Contract & | co | |||
) |
Read a contract from the database.
session | Database session to use. | |
co | Contract to read. |
OsbException | in case of an illegal effective or preferred status of the contract in the database. |
bool OSB_DB::ContractGw::incObjVs | ( | const Session & | session, | |
OSB_LIB::Contract & | co | |||
) | [private] |
Increment the object version of a contract.
session | Database session to use. | |
co | The contract who's object version is increased. |
bool OSB_DB::ContractGw::insContract | ( | const Session & | session, | |
OSB_LIB::Contract & | co | |||
) | [private] |
Add a new contract object.
Before the function call, the object must have all its member attributes assigned (except oid, object version and createDate). After the function call, the object will have its id_, objVs_ and createdDate_ set.
session | Database session. | |
co | New contract object to be added into database. |
OsbException | for the following errors:
|
OSB_LIB::ObjectStatus OSB_DB::ContractGw::lock | ( | const Session & | session, | |
const OSB_LIB::Contract & | co, | |||
bool | noWait | |||
) | [private] |
Lock a contract in the database.
session | Database session to use. | |
co | The contract to lock. | |
noWait | Don't wait if locked by another session? |
OSB_LIB::ObjectStatus OSB_DB::ContractGw::lock | ( | const Session & | session, | |
const OSB_LIB::Contract::Oid & | coId, | |||
bool | noWait | |||
) | [private] |
Lock a contract entry in database.
session | Database session to use. | |
coId | Id of the contract to lock. | |
noWait | Don't wait if locked by another session? |
void OSB_DB::ContractGw::lockPersProducts | ( | const Session & | session, | |
const OSB_LIB::Contract::Oid & | coId, | |||
bool | noWait | |||
) | [private] |
Lock all pers product of a contract in database.
session | Database session. | |
coId | Contract id. | |
noWait | Set to true if the function should not wait for other process to unlock the resource. If waiting is required, set to false. |
ContractGw& OSB_DB::ContractGw::operator= | ( | const ContractGw & | rhs | ) | [private] |
Prevent assignment: not implemented.
bool OSB_DB::ContractGw::setEffStatus | ( | const Session & | session, | |
const OSB_LIB::Contract & | co | |||
) | [private] |
Save the effective status of a contract.
session | Database session to use. | |
co | Contract to process. |
bool OSB_DB::ContractGw::setPrefStatus | ( | const Session & | session, | |
const OSB_LIB::Contract & | co | |||
) | [private] |
Save the preferred status of a contract.
session | Database session to use. | |
co | Contract to process. |
void OSB_DB::ContractGw::storeChange | ( | const Session & | session, | |
const OSB_LIB::Contract::Oid & | coId, | |||
OSB_LIB::StatusChange & | change | |||
) | [private] |
Store status change for a contract in the database.
session | Database session to use. | |
coId | Contract object id. | |
change | Status change to store. |
void OSB_DB::ContractGw::storeRequest | ( | const Session & | session, | |
const OSB_LIB::Contract::Oid & | coId, | |||
OSB_LIB::StatusRequest & | status | |||
) | [private] |
Store status request for a contract in the database.
session | Database session to use. | |
coId | Contract object id. | |
status | Status request to store. |
bool OSB_DB::ContractGw::updContract | ( | const Session & | session, | |
const OSB_LIB::Contract & | co | |||
) | [private] |
Update a contract object.
The function will modify the data of a contract in the database with the data contained within the input object. The contract object entry in the database will only be updated if the input object truly represent the current entry in the database (the object version is the same).
session | Database session. | |
co | contract object to be updated. |
OsbException | for the following errors:
|
friend class OSB_LIB::Contract [friend] |
friend class OSB_LIB::PersProduct [friend] |