Index

DKEntityDefFed

Purpose:

DKEntityDefFed is a concrete class which implements dkEntityDef interface for a federated datastore. A federated entity is defined by mapping to one or more native entities in some content servers.

A DKEntityDefFed contains a set of DKAttrDefFed, defining attributes in this entity, then mapping them to some native attributes on content servers. The mapping association is defined by dkSchemaMapping object.

The class has functions to access federated entity information as well as to:

Class summary:

class DKEntityDefFed : public dkEntityDef
{
public:
 
   DKEntityDefFed (dkDatastore* ds);
   virtual ~DKEntityDefFed ();
 
   virtual dkAttrDef* createAttr ();
   virtual dkAttrDef* getAttr (const char* attrName);
   virtual dkCollection* listAttrs ();
   virtual DKString* listAttrNames (long& arraySize);
   virtual void add(dkEntityDef* subEntityDef);
   virtual void del(dkEntityDef* subEntityDef);
   virtual void add ();
   virtual void del ();
   virtual void add (dkAttrDef* attrDef);
   virtual void del (dkAttrDef* attrDef);
   void addSchemaMapping (dkSchemaMapping* smObj);
   void removeSchemaMapping (const char* smName);
   dkSchemaMapping* getSchemaMapping (const char* smName);
   DKString* listSchemaMappingNamesByServer (const char* serverName,
                                             long& arraySize);
   dkCollection* listSchemaMappings ();
   DKString* listSchemaMappingNames (long& arraySize);    
   dkServerDef* getDataSource (const char* dataSourceName);
   dkCollection* listDataSources ();
   DKString* listDataSourceNames (long& arraySize);
};

Members:

Constructors and destructor
   DKEntityDefFed (dkDatastore* ds);
   virtual ~DKEntityDefFed ();
 

Member functions
Creates a new dkAttrDef object and returns it.

createAttr
  virtual dkAttrDef* createAttr();

getAttr
Gets the attribute object with a given name.
   virtual dkAttrDef* getAttr (const char* attrName);
 

listAttrs
Gets the list of attributes defined in this entity.
   virtual dkCollection* listAttrs ();
 

listAttrNames
Gets the list of attribute names defined in this entity.
   virtual DKString* listAttrNames (long& arraySize);
 

add
The first form adds the given sub-entity definition to this entity in the persistent datastore. The second form adds this entity definition to the persistent datastore, that is, make this entity definition persistent. The third form adds the given attribute definition to this entity in the persistent datastore, that is, make this attribute definition persistent.
   virtual void add(dkEntityDef* subEntityDef);
   virtual void add ();
   virtual void add (dkAttrDef* attrDef);
 

del
The first form deletes the given sub-entity definition from this entity in the persistent datastore. The second form deletes this entity definition from the persistent datastore, such as a drop table for RDB. The in-memory copy is not affected, until the datastore definition is refreshed. The third form deletes the given attribute definition from this entity in the persistent datastore. The in-memory copy is not affected, until this entity is refreshed.
   virtual void del(dkEntityDef* subEntityDef);
   virtual void del ();
   virtual void del (dkAttrDef* attrDef);
 

addSchemaMapping
Adds another mapping definition of this entity, usually a new mapping to another back-end server.
   void addSchemaMapping (dkSchemaMapping* smObj);
 

removeSchemaMapping
Removes a given mapping name from this entity definition.
   void removeSchemaMapping (const char* smName);
 

getSchemaMapping
Gets the schema mapping with the given name from this entity definition.
   dkSchemaMapping* getSchemaMapping (const char* smName);
 

listSchemaMappings
Lists all schema mappings defined for this entity.
   dkCollection* listSchemaMappings ();
 

listSchemaMappingNames
Lists all schema mapping names defined for this entity.
   DKString* listSchemaMappingNames (long& arraySize);
 

getDataSource
Gets a list of datasource definition objects.
   dkServerDef* getDataSource (const char* dataSourceName);
 

listDataSources
Gets a list of datasource definition objects.
   dkCollection* listDataSources ();
 

listDataSourceNames
Gets a list of datasource names.
   DKString* listDataSourceNames (long& arraySize);
 

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.