OSB_DB::AssociateGw Class Reference

List of all members.

Detailed Description

Database-gateway class for Associate.

Definition at line 60 of file associate-gw.h.

Public Types

Public Member Functions

Private Member Functions

Friends


Member Typedef Documentation

typedef OSB_LIB::Id<OSB_LIB::Associate> OSB_DB::AssociateGw::AssociateId

Definition at line 73 of file associate-gw.h.

typedef std::set<AssociateId> OSB_DB::AssociateGw::AssociateIds

Definition at line 74 of file associate-gw.h.


Constructor & Destructor Documentation

OSB_DB::AssociateGw::AssociateGw ( const AssociateGw rhs  )  [private]

Prevent copying: Copy constructor not implemented.

OSB_DB::AssociateGw::AssociateGw (  )  [inline]

Default constructor.

Definition at line 78 of file associate-gw.h.


Member Function Documentation

bool OSB_DB::AssociateGw::fetch ( const Session session,
OSB_LIB::Associate assoc 
)

Read an associate from the database.

The function (re)reads an existing associate from the database. It populates data members if a matching row is found.

Parameters:
session Database session to use.
assoc Associate to read.
Exceptions:
OsbException 109 for an unknown preferred or effective status.
Returns:
True if the associate was read from the database, else false. In the latter case the assoc remains unchanged.

OSB_LIB::Associate::AutoPtr OSB_DB::AssociateGw::fetch ( const Session session,
const OSB_LIB::Associate::Oid asId 
)

Load an associate from database for a given object id.

Parameters:
session Database session to use.
asId Object id of associate.
Exceptions:
OsbException 47 for illegal associate type.
OsbException from OSB_LIB::Associate::read.
Returns:
An auto pointer with the newly allocated associate. It is 0 if the associate does not exist in the database.
The function reads the type of the associate from ASSOCIATE, uses the OSB_LIB::AssociateFactory to allocate a new associate of the correct type and lets it read itself from the database.

long OSB_DB::AssociateGw::fetchChildren ( const Session session,
OSB_LIB::Associate associate 
) [private]

Load all the next level associates.

Read all children for an associate and add them to the destination list.

Parameters:
session Database session to use.
associate Associate to read for.
Returns:
Number of objects populated.

bool OSB_DB::AssociateGw::incObjVs ( const Session session,
OSB_LIB::Associate assoc 
) [private]

Increment the object version of an associate.

Parameters:
session Database session to use.
assoc The associate who's object version is increased.
Returns:
true if the object version of assoc was increased by 1, else false.

bool OSB_DB::AssociateGw::insert ( const Session session,
OSB_LIB::Associate assoc 
) [private]

Insert an associate to the database.

Before the function call, the associate object to be added must have all its data members set except oid. After the function completed successfully, oid and objVs will be set.

Parameters:
session Database session to use.
assoc Ref to associate to be inserted.
Exceptions:
OsbException if a data member of assoc
  • is too long for the database.
  • is empty and NOT NULL in the database.
Returns:
True if the associate was inserted into the database.

OSB_LIB::ObjectStatus OSB_DB::AssociateGw::lock ( const Session session,
const OSB_LIB::Associate assoc,
bool  noWait 
) [private]

Lock an associate in the database.

Parameters:
session Database session to use.
assoc The associate to lock.
noWait Don't wait if locked by another session?
Returns:
The object status of the associate.

OSB_LIB::ObjectStatus OSB_DB::AssociateGw::lock ( const Session session,
const OSB_LIB::Associate::Oid asId,
bool  noWait 
) [private]

Lock an associate entry in the database.

Parameters:
session Database session to use.
asId Object id of associate to lock.
noWait Don't wait if locked by another session?
Returns:
The object status of the associate, (modified is not applicable).

void OSB_DB::AssociateGw::lockChildren ( const Session session,
const OSB_LIB::Associate::Oid asId,
bool  noWait 
) [private]

Lock all children entries of an associate in database.

Parameters:
session Database session to use.
asId Object id of associate.
noWait Wait if locked by another session?

void OSB_DB::AssociateGw::lockContracts ( const Session session,
const OSB_LIB::Associate::Oid asId,
bool  noWait 
) [private]

Lock all contract entries of one owner in database.

Parameters:
session Database session to use.
asId Owner id.
noWait Wait if locked by another session?

AssociateGw& OSB_DB::AssociateGw::operator= ( const AssociateGw rhs  )  [private]

Prevent assignment: Assignment not implemented.

bool OSB_DB::AssociateGw::remove ( const Session session,
const OSB_LIB::Associate assoc 
) [private]

Remove an associate to the database.

Parameters:
session Database session to use.
assoc Associate to remove.
Exceptions:
OsbException if assoc
  • was modified by another application.
  • is user of personalized products.
Returns:
True if the associate was removed into the database.

long OSB_DB::AssociateGw::searchByName ( const Session session,
AssociateIds idList,
OSB_LIB::AnCFilter filter 
)

Search all associates by name.

Parameters:
session Database session to use.
idList List of associate ids to store.
filter Filter to use.
Returns:
Number of objects populated.

bool OSB_DB::AssociateGw::setEffStatus ( const Session session,
const OSB_LIB::Associate assoc 
) [private]

Save the effective status of an associate.

Parameters:
session Database session to use.
assoc Associate to process.
Returns:
true if the effective status was updated, else false.

bool OSB_DB::AssociateGw::setPrefStatus ( const Session session,
const OSB_LIB::Associate assoc 
) [private]

Save the preferred status for an associate.

Parameters:
session Database session to use.
assoc Associate to process.
Returns:
true if successful, else false.

void OSB_DB::AssociateGw::storeChange ( const Session session,
const OSB_LIB::Associate::Oid asId,
OSB_LIB::StatusChange change 
) [private]

Store status change for an associate in the database.

Parameters:
session Database session to use.
asId Associate object id.
change Status change to store.

void OSB_DB::AssociateGw::storeRequest ( const Session session,
const OSB_LIB::Associate::Oid asId,
OSB_LIB::StatusRequest status 
) [private]

Store status request for an associate in the database.

Parameters:
session Database session to use.
asId Associate object id.
status Status request to store.

bool OSB_DB::AssociateGw::update ( const Session session,
const OSB_LIB::Associate assoc 
) [private]

Update an associate to the database.

ObjVs will be set after the successful update.

Parameters:
session Database session to use.
assoc Ref to associate to be updated.
Exceptions:
OsbException the name of assoc is empty or too long for the database.
Returns:
True if the associate was updated into the database.


Friends And Related Function Documentation

friend class OSB_LIB::AnCList [friend]

Allow insert, update and delete.

Definition at line 68 of file associate-gw.h.

friend class OSB_LIB::Associate [friend]

Allow insert, update and delete.

Definition at line 66 of file associate-gw.h.

friend class OSB_LIB::Contract [friend]

Only allow Contract to access lock(...).

Definition at line 71 of file associate-gw.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:08:53 2006 for OSB Library by  doxygen 1.4.7