The class provide the database operations needed for the classes PersProduct, PersProductNode and all classes derived from PersProductItem.
Definition at line 66 of file persproduct-gw.h.
OSB_DB::PersProductGw::PersProductGw | ( | const PersProductGw & | ) | [private] |
Do not allow copying: body not defined.
OSB_DB::PersProductGw::PersProductGw | ( | ) | [inline] |
Empty default constructor.
Destructor by compiler.
Definition at line 89 of file persproduct-gw.h.
OSB_LIB::ObjectStatus OSB_DB::PersProductGw::checkObjVs | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp | |||
) | [private] |
Check the object version of pers. product against the database.
session | Database session to use. | |
pp | Pers. product to verify. |
bool OSB_DB::PersProductGw::delPersNode | ( | const Session & | session, | |
const OSB_LIB::PersProductNode::Oid & | oid | |||
) | [private] |
Remove a PersProductNode from the table PERS_NODE.
The function removes a row from the table PERS_NODE for a personalized product node.
session | Session to use. | |
oid | Id of the pers. node to delete. |
bool OSB_DB::PersProductGw::delPersProduct | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp | |||
) | [private] |
Delete a pers. product from the table PERS_PRODUCT.
session | Database session to use. | |
pp | PersProduct to delete. |
bool OSB_DB::PersProductGw::delPersProductItem | ( | const Session & | session, | |
OSB_LIB::PersProductItem & | item | |||
) | [private] |
Delete a personalized product item.
The function deletes a pers. product item from PERS_ITEM.
The implementation relies on the foreign key constraints to prevent deletion of pers. product items with dependent rows.
session | Database session to use. | |
item | Personalized product item to delete. |
bool OSB_DB::PersProductGw::fetch | ( | const Session & | session, | |
OSB_LIB::PersProductItem & | item | |||
) | [private] |
Read a personalized product item.
(Re)reads a pers. product item from the database, using the item's object id as selection criteria. If a matching row is found, it sets the pers. item assign and deassign date.
session | Database session to use. | |
item | Personalized product item to (re)read. |
bool OSB_DB::PersProductGw::fetch | ( | const Session & | session, | |
OSB_LIB::PersProductNode & | pn | |||
) |
Read a personalized product node by its object id.
session | Database session to use. | |
pn | Pers. product node to read: its object id must be set. |
OsbException | in case of an illegal status. |
bool OSB_DB::PersProductGw::fetch | ( | const Session & | session, | |
OSB_LIB::PersProduct & | pp | |||
) |
Read a personalized product by its object id.
session | Database session to use. | |
pp | Pers. product to read: its object id must be set. |
OsbException | in case of an illegal status. |
long OSB_DB::PersProductGw::fetch | ( | const Session & | session, | |
OSB_LIB::Contract & | co | |||
) |
Read personalized products of a contract.
Read all personalized product for a contract and add them to the destination list. (The list is cleared before adding the read pers. products.)
session | Database session to use. | |
co | Contract to read for. |
OsbException | in case of an illegal status. |
long OSB_DB::PersProductGw::fetchItems | ( | const Session & | session, | |
OSB_LIB::PersProductNode & | persNode | |||
) |
Read pers. product items for a pers. product node.
For each matching row in PERS_ITEM the function uses OSB_LIB::ProductItemFactory to create a pers. item of the appropriate type. After setting the base class data members, OSB_LIB::PersProductItem::read() is called to retrieve type specific data from the database.
Exception safety: Newly constructed pers. items are stored in a temporary list which is swapped with the list of `persNode' on regular return: In case of an exception, the original list of the pers. node remains unchanged.
session | Database session to use: changes are neither commited not rolled back. | |
persNode | Pers. product node to read for. |
OsbException |
|
long OSB_DB::PersProductGw::fetchNodes | ( | const Session & | session, | |
OSB_LIB::PersProduct & | pp | |||
) |
Read personalized nodes for a personalized product.
Read all nodes for a personalized product and store in destination list.
The function uses a temporary list to store the pers. nodes read from the database and, on sucessful completion, swaps it with the list passed as argument.
session | Database session to use. | |
pp | Personalized product to read for. |
OsbException | in case of an illegal status. |
OSB_LIB::Id<OSB_LIB::Contract> OSB_DB::PersProductGw::getContract | ( | const Session & | session, | |
const OSB_LIB::PersProduct::Oid & | ppId | |||
) |
Get the contract id of a pers. product.
session | Database session to use. | |
ppId | Id of the pers. product to look-up. |
bool OSB_DB::PersProductGw::incObjVs | ( | const Session & | session, | |
OSB_LIB::PersProduct & | pp | |||
) |
Increment the object version of a pers. product.
This function will add 1 to the OBJ_VS in PERS_PRODUCT table.
session | Database session to use. | |
pp | Pers. product for which to increase the object version. |
bool OSB_DB::PersProductGw::incPersProdObjVs | ( | const Session & | session, | |
const OSB_LIB::PersProduct::Oid & | ppId, | |||
long & | objVs, | |||
bool & | uptodate | |||
) |
Add 1 to Object Version (OBJ_VS).
This function will add 1 to the OBJ_VS in PERS_PRODUCT database.
session | Database session to use: changes are neither commited not rolled back. | |
ppId | Pers. product oid to update. | |
objVs | Old Object version. It will be updated to the new one. | |
uptodate | Return true if the object version is uptodate before it gets updated in the database. |
bool OSB_DB::PersProductGw::insPersNode | ( | const Session & | session, | |
OSB_LIB::PersProductNode & | persNode | |||
) | [private] |
Insert a PersProductNode into the table PERS_NODE.
The function inserts a row to the table PERS_NODE for a personalized product node.
session | Session to use. | |
persNode | PersProductNode to insert. |
OsbException | if the node has an illegal preferred or effective status. |
bool OSB_DB::PersProductGw::insPersProduct | ( | const Session & | session, | |
OSB_LIB::PersProduct & | pp | |||
) | [private] |
Insert a pers. product into the table PERS_PRODUCT.
session | Session to use. | |
pp | PersProduct to insert. |
bool OSB_DB::PersProductGw::insPersProductItem | ( | const Session & | session, | |
OSB_LIB::PersProductItem & | item | |||
) | [private] |
Insert a personalized product item.
The function creates an entry in PERS_ITEM. It sets the new object id and the assigment date of `item'.
session | Database session to use. | |
item | Personalized product item to insert. |
OsbException | in case of a database error. |
OSB_LIB::ObjectStatus OSB_DB::PersProductGw::lock | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp, | |||
bool | noWait | |||
) | [private] |
Lock a pers. product entry in database.
session | Database session. | |
pp | Pers. product to lock. | |
noWait | Don't wait for database locks? |
OSB_LIB::ObjectStatus OSB_DB::PersProductGw::lock | ( | const Session & | session, | |
const OSB_LIB::PersProduct::Oid & | ppId, | |||
bool | noWait | |||
) | [private] |
Lock a pers. product entry in database.
session | Database session. | |
ppId | Object id of pers. product to be locked. | |
noWait | Don't wait for database locks? |
PersProductGw& OSB_DB::PersProductGw::operator= | ( | const PersProductGw & | ) | [private] |
Do not allow assignment: body not defined.
bool OSB_DB::PersProductGw::setEffStatus | ( | const Session & | session, | |
const OSB_LIB::PersProductNode & | persNode | |||
) | [private] |
Save the effective status of a pers. node.
session | Database session to use. | |
persNode | Pers. node to process. |
bool OSB_DB::PersProductGw::setEffStatus | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp | |||
) | [private] |
Save the effective status of a pers. product.
session | Database session to use. | |
pp | Pers. product to process. |
bool OSB_DB::PersProductGw::setPrefStatus | ( | const Session & | session, | |
const OSB_LIB::PersProductNode & | persNode | |||
) | [private] |
Save the prefer status of a pers. node.
session | Database session to use. | |
persNode | Pers. node to process. |
bool OSB_DB::PersProductGw::setPrefStatus | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp | |||
) | [private] |
Save the prefer status of a pers. product.
session | Database session to use. | |
pp | Pers. product to process. |
void OSB_DB::PersProductGw::storeChange | ( | const Session & | session, | |
const OSB_LIB::PersProductNode::Oid & | ppnId, | |||
OSB_LIB::StatusChange & | change | |||
) | [private] |
Store status change for a pers. product node.
session | Database session to use. | |
ppnId | Id of the pers. product node. | |
change | Status change to store. |
void OSB_DB::PersProductGw::storeChange | ( | const Session & | session, | |
const OSB_LIB::PersProduct::Oid & | ppId, | |||
OSB_LIB::StatusChange & | change | |||
) | [private] |
Store status change for a pers. product.
session | Database session to use. | |
ppId | Id of the pers. product. | |
change | Status change to store. |
void OSB_DB::PersProductGw::storeRequest | ( | const Session & | session, | |
const OSB_LIB::PersProductNode::Oid & | ppnId, | |||
OSB_LIB::StatusRequest & | status | |||
) | [private] |
Store status request for a pers. product node.
session | Database session to use. | |
ppnId | Id of the pers. product node. | |
status | Status request to store. |
void OSB_DB::PersProductGw::storeRequest | ( | const Session & | session, | |
const OSB_LIB::PersProduct::Oid & | ppId, | |||
OSB_LIB::StatusRequest & | status | |||
) | [private] |
Store status request for a pers. product in the database.
session | Database session to use. | |
ppId | Id of the pers. product. | |
status | Status request to store. |
bool OSB_DB::PersProductGw::updPersProductItem | ( | const Session & | session, | |
OSB_LIB::PersProductItem & | item | |||
) | [private] |
Update a personalized product item.
The function updates a personalized product item, using the item's object id as selection criteria. Updated columns do not include PERS_PRODUCT_ID and PRODUCT_NODE_ID.
session | Database session to use. | |
item | Personalized product item to update. |
bool OSB_DB::PersProductGw::updPpiAssignTs | ( | const Session & | session, | |
OSB_LIB::PersProductItem & | item, | |||
const OSB_LIB::DateTime & | newTs | |||
) | [private] |
Change the assignment timestamp of a pers. product item to its node.
session | Database session to use. | |
item | Pers. product item for which to change the assignment timestamp. | |
newTs | New date and time of the assignment. |
OsbException | as specified by PersProductItem: if the new assignment period would overlap with other pers. items assigned to the pers. node. |
bool OSB_DB::PersProductGw::updProductUser | ( | const Session & | session, | |
const OSB_LIB::PersProduct & | pp | |||
) | [private] |
Update product user of pers. product object.
The object version will also be updated.
session | Database session. | |
pp | Pers product object to be updated. |
friend class OSB_LIB::PersProduct [friend] |
Definition at line 79 of file persproduct-gw.h.
friend class OSB_LIB::PersProductItem [friend] |
Allow PersProductItem to call it's I/O supporting functions.
These are: fetch(..., PersProductItem&), insPersProductItem, updPersProductItem and delPersProductItem.
Definition at line 78 of file persproduct-gw.h.
friend class OSB_LIB::PersProductNode [friend] |
Definition at line 80 of file persproduct-gw.h.