Purpose:
dkXDOBase is an abstract class (a subclass of dkDataObjectBase) that represents a data value, ranging from a simple UDT (User Defined Type) to a complex LOB (Large Object). dkXDOBase provides a set of methods specifically used to communicate with dkDatastore objects. You should subclass from dkXDOBase and provide methods that correspond to their specific UDT or LOB behaviors.
Heirarchy:
dkDataObjectBase dkXDOBase
Class summary:
class dkXDOBase : public dkDataObjectBase { public: virtual dkXDOBase(); virtual void setNull() = 0; virtual DKBoolean isNull() const = 0; virtual void open(); virtual void open(const char* afileName); virtual dkDataObjectBase& operator= (const dkDataObjectBase& adkXDOBase); virtual dkDataObjectBase& operator= (const dkDataObjectBase& adkXDOBase); virtual dkXDOBase& operator= (const dkXDOBase& aXDOBase); virtual DKBoolean operator== (const dkXDOBase& aXDOBase) const = 0; virtual DKBoolean operator!= (const dkXDOBase& aXDOBase) const = 0; virtual short protocol() const; virtual void setInstanceOpenHandler(const char* ahandler, DKBoolean newSynchronousFlag); virtual void setClassOpenHandler(const char* ahandler, DKBoolean newSynchronousFlag); virtual DKString getOpenHandler(); virtual DKBoolean isOpenSynchronous(); };
When defining a subclass, you should override the appropriate get/setValue() to match the corresponding type of the UDT or LOB in the datastore. For example, for a Date UDT with the database type of DB2 CHAR, you should override the get/setValueString() method. In addition, you should also override the deletingValue() method, if the object requires some clean-up procedures when the corresponding row is deleted. This method will be called by the datastore object before deleting the row in the database.
The methods protocol() and getObjectType() also need to be redefined in the subclass to return the appropriate value. Currently, XDO classes support two protocols:
Members:
virtual void setNull();
virtual DKBoolean isNull() const;
virtual void open();
virtual void open(const char* afileName);
virtual short protocol() const;
virtual void setInstanceOpenHandler(const char* ahandler, DKBoolean newSynchronousFlag);
virtual void setClassOpenHandler(const char* ahandler, DKBoolean newSynchronousFlag);
virtual DKString getOpenHandler();
virtual DKBoolean isOpenSynchronous();
Exceptions:
DKXDOError
This exception is thrown if the get/setValue function is not overridden in the subclass.
(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.