OSB_DB::TariffGw Struct Reference

List of all members.

Detailed Description

Database interface for Tariff.

Definition at line 161 of file tariff-gw.h.

Public Member Functions

Private Member Functions

Friends


Member Function Documentation

OSB_LIB::ObjectStatus OSB_DB::TariffGw::checkObjVs ( const Session session,
const OSB_LIB::Tariff tf 
) [private]

Check the current object version.

Parameters:
session Database session.
tf Tariff object which object version is to be verified.
Returns:
Result of the object version verification. Possible values are:
  • objUnchanged
  • objModified
  • objDeleted
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TariffGw::delTariff ( const Session session,
OSB_LIB::Tariff tf 
) [private]

Delete a tariff from database.

The tariff to be deleted must already exist in the database. Besides that, the object version of the tariff 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. After the function call, the object's id will be unset but the object itself is not deleted automatically. Application is responsible to delete the tariff object itself.

Parameters:
session Database session.
tf Tariff object to be deleted.
Returns:
true if deletion is successful else false.
Exceptions:
OsbException for the following errors:
  • Database error.

long OSB_DB::TariffGw::fetch ( const Session session,
OSB_LIB::Tariffs tfs 
)

Get a list of all available tariffs.

This function retrieve all the available tariffs from database.

Parameters:
session Database session.
tfs Container that stores all the retrieved object
Returns:
Number of tariff object retrieved.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TariffGw::fetch ( const Session session,
OSB_LIB::Tariff tf 
)

Populate a tariff object with data.

This function accept an empty tariff object with only its oid set. It will populate all other data members of the object.

Parameters:
session Database session.
tf Tariff object to be populated.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TariffGw::insTariff ( const Session session,
OSB_LIB::Tariff tf 
) [private]

Add a new tariff object.

Before the function call, the object must have all its member attributes assigned (except oid and object version). After the function call, the object will have its oid_ and objVs_ set.

Parameters:
session Database session.
tf New tariff object to be added into database.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Database error.
  • The name is too long.
  • the description is too long.

bool OSB_DB::TariffGw::updTariff ( const Session session,
OSB_LIB::Tariff tf 
) [private]

Update a tariff object.

The function will modify the data of a tariff in the database with the data contained within the input object. The tariff 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).

Parameters:
session Database session.
tf Tariff object to be updated.
Returns:
true if updated successfully else false.
Exceptions:
OsbException for the following errors:
  • Database error.
  • The name is too long.
  • The description is too long.


Friends And Related Function Documentation

friend class OSB_LIB::Tariff [friend]

Tariff needs to call the private member functions.

Definition at line 165 of file tariff-gw.h.


The documentation for this struct was generated from the following file:
Generated on Sat Sep 2 14:09:03 2006 for OSB Library by  doxygen 1.4.7