Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class dkAbstractEntityDef

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.dkAbstractEntityDef
All Implemented Interfaces:
dkEntityDef, DKMessageId, java.io.Serializable
Direct Known Subclasses:
DKAppGrpDefOD, DKBinderDefDD, DKCabinetDefDD, DKCatalogDefQBIC, DKComponentTypeDefICM, DKDatabaseDefDES, DKDatabaseDefQBIC, DKDocumentDefDD, DKEntityDefFed, DKEntityDefIC, DKEntityDefIP, DKEntityInventoryDefFed, DKFolderOD, DKIndexClassDefDL, DKIndexClassDefV4, DKRoomDefDD, DKSearchIndexDefTS, DKTableDefDB2, DKTableDefDJ, DKTableDefJDBC

public class dkAbstractEntityDef
extends java.lang.Object
implements dkEntityDef, DKMessageId, java.io.Serializable

This class defines methods to access entity information as well as to:

In this class, all methods related sub-entities all throw DKUsageError indicating that the default datastores does not support sub-entities. However, if the datastore support this kind of multi-level entities, for example, QBIC datastore, the sub-class for these datastore need to implement these methods to overwrite the exceptions.

See Also:
Serialized Form

Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
dkAbstractEntityDef()
          Constructs a new dkAbstractEntityDef class without owner datastore object.
dkAbstractEntityDef(dkDatastore ds)
          Constructs a new dkAbstractEntityDef class with owner datastore object
 
Method Summary
 void add()
          Adds this entity definition to the persistent store, i.e.
 void add(dkAttrDef attrObj)
          Adds the given attribute definition object to the this entity in the persistent store.
 void add(dkEntityDef subEntityObj)
          Adds the sub entity definition object to the this entity in the persistent store.
 void addAttr(dkAttrDef attrObj)
          Adds the given attribute definition object to the this entity.
 void addSubEntity(dkEntityDef subEntityObj)
          Adds the sub entity definition object to the this entity in memory.
 void clearCache()
          Clear entity def cache
 dkAttrDef createAttr()
          Creates new dkAttrDef and returns it to caller.
 dkEntityDef createSubEntity()
          Creates new dkEntityDef and returns it to caller.
 java.lang.String datastoreName()
          Gets the name of this datastore object.
 java.lang.String datastoreType()
          Gets the type for this datastore object
 void del()
          Deletes this entity from the persistent store, e.g.
 void del(dkAttrDef attrObj)
          Deletes the given attribute from this entity in the persistent store.
 void del(dkEntityDef subEntityObj)
          Delete the sub entity definition object from this entity in the persistent store.
 void deleteAttr(java.lang.String attrName)
          Deletes the given attribute from this entity in the persistent store.
 void deleteSubEntity(java.lang.String subEntityName)
          Delete the sub entity definition object from this entity in the persistent store.
 dkAttrDef getAttr(java.lang.String attrName)
          Retrieves an attribute object from a given attribute name
 dkDatastore getDatastore()
          Gets the reference to the owner datastore object
 java.lang.String getDescription()
          Get the description of this entity
 java.lang.String getName()
          Gets entity name
 java.lang.String getParentEntityName()
          Gets the parent entity name
 dkEntityDef getSubEntity(java.lang.String subEntityName)
          Gets a sub entity object from a given sub entity name.
 short getType()
          Gets type of this entity
 boolean hasSubEntities()
          Checks if this entity has sub entity objects.
 boolean isSearchable()
          Checks if the entity is searchable
 boolean isTextSearchable()
          Checks if this entity is text searchable
 java.lang.String[] listAttrNames()
          Gets a list of attributes
 dkCollection listAttrs()
          Gets a list of attributes
 dkCollection listSubEntities()
          Gets a list of sub entities.
 java.lang.String[] listSubEntityNames()
          Gets a list of sub entity names
 void removeAttr(java.lang.String attrName)
          Removes the given attribute from this entity.
 void removeSubEntity(java.lang.String subEntityName)
          Removes the sub entity definition object from this entity in memory.
 dkAttrDef retrieveAttr(java.lang.String attrName)
          Retrieves an attribute object from a given attribute name from the persistent datastore.
 dkEntityDef retrieveSubEntity(java.lang.String subEntityName)
          Retrieves a sub entity object from a given sub entity name from the persistent datastore.
 void setDatastore(dkDatastore ds)
          Sets the reference to the owner datastore object
 void setDescription(java.lang.String desc)
          Sets description of this entity
 void setName(java.lang.String name)
          Sets entity name
 void setParentEntityName(java.lang.String parentEntityName)
          Sets the parent entity name
 void setTextSearchable(boolean textSearchable)
          Sets this entity to be text searchable
 void setType(short entityType)
          Sets type of this entity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

dkAbstractEntityDef

public dkAbstractEntityDef()
Constructs a new dkAbstractEntityDef class without owner datastore object.

dkAbstractEntityDef

public dkAbstractEntityDef(dkDatastore ds)
Constructs a new dkAbstractEntityDef class with owner datastore object
Parameters:
ds - reference to owner datastore object
Method Detail

setDatastore

public void setDatastore(dkDatastore ds)
Sets the reference to the owner datastore object
Specified by:
setDatastore in interface dkEntityDef
Following copied from interface: com.ibm.mm.sdk.common.dkEntityDef
Parameters:
ds - datastore

getDatastore

public dkDatastore getDatastore()
Gets the reference to the owner datastore object
Specified by:
getDatastore in interface dkEntityDef
Returns:
the dkDatastore object

datastoreName

public java.lang.String datastoreName()
                               throws java.lang.Exception
Gets the name of this datastore object.
Specified by:
datastoreName in interface dkEntityDef
Returns:
datastore name
Throws:
DKException - if error occurs

datastoreType

public java.lang.String datastoreType()
                               throws java.lang.Exception
Gets the type for this datastore object
Specified by:
datastoreType in interface dkEntityDef
Returns:
datastore type
Throws:
DKException - if error occurs

getName

public java.lang.String getName()
Gets entity name
Specified by:
getName in interface dkEntityDef
Returns:
name of this entity

setName

public void setName(java.lang.String name)
Sets entity name
Specified by:
setName in interface dkEntityDef
Parameters:
name - new name to be set to this entity object

getType

public short getType()
Gets type of this entity
Specified by:
getType in interface dkEntityDef
Returns:
entity type

setType

public void setType(short entityType)
Sets type of this entity
Specified by:
setType in interface dkEntityDef
Parameters:
entityType - entity type

getDescription

public java.lang.String getDescription()
Get the description of this entity
Specified by:
getDescription in interface dkEntityDef
Returns:
string containing description.

setDescription

public void setDescription(java.lang.String desc)
Sets description of this entity
Specified by:
setDescription in interface dkEntityDef
Parameters:
desc - description about this entity

isSearchable

public boolean isSearchable()
                     throws DKException,
                            java.lang.Exception
Checks if the entity is searchable
Specified by:
isSearchable in interface dkEntityDef
Returns:
true if entity is searchable

hasSubEntities

public boolean hasSubEntities()
                       throws DKException,
                              java.lang.Exception
Checks if this entity has sub entity objects. This class will always return false by default, i.e. has no sub entities.
Specified by:
hasSubEntities in interface dkEntityDef
Returns:
true if has sub entities, false otherwise.

createSubEntity

public dkEntityDef createSubEntity()
                            throws DKException,
                                   java.lang.Exception
Creates new dkEntityDef and returns it to caller.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
createSubEntity in interface dkEntityDef
Returns:
new dkEntityDef object.
Throws:
DKException - if the datastore does not support multi-level entity, i.e. this entity object does not have sub-entities.

getParentEntityName

public java.lang.String getParentEntityName()
Gets the parent entity name
Specified by:
getParentEntityName in interface dkEntityDef
Returns:
parent entity name.

setParentEntityName

public void setParentEntityName(java.lang.String parentEntityName)
Sets the parent entity name
Specified by:
setParentEntityName in interface dkEntityDef
Parameters:
parentEntityName - parent entity name.

getSubEntity

public dkEntityDef getSubEntity(java.lang.String subEntityName)
                         throws DKException,
                                java.lang.Exception
Gets a sub entity object from a given sub entity name. (memory-only)

Note:DKUsageError exception thrown if method is not implemented

Specified by:
getSubEntity in interface dkEntityDef
Parameters:
subEntityName - name of sub entity to get
Returns:
an (sub) entity object
Throws:
DKException - if the datastore does not support multi-level entity, i.e. this entity object does not have sub-entities.

retrieveSubEntity

public dkEntityDef retrieveSubEntity(java.lang.String subEntityName)
                              throws DKException,
                                     java.lang.Exception
Retrieves a sub entity object from a given sub entity name from the persistent datastore. This method is provided to support multi-level document model.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
retrieveSubEntity in interface dkEntityDef
Parameters:
subEntityName - name of entity to be retrieved
Returns:
an (sub) entity object
Throws:
DKException - if the datastore does not support multi-level entity, i.e. this entity object does not have sub-entities.

listSubEntities

public dkCollection listSubEntities()
                             throws DKException,
                                    java.lang.Exception
Gets a list of sub entities. This method will throw DKException by default, if your back-end datastore supports subentities, you need to overwrite this method.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
listSubEntities in interface dkEntityDef
Returns:
a dkCollection of dkEntityDef's
Throws:
DKException - if the datastore does not support multi-level entity, i.e. this entity object does not have sub-entities.

listSubEntityNames

public java.lang.String[] listSubEntityNames()
                                      throws DKException,
                                             java.lang.Exception
Gets a list of sub entity names

Note:DKUsageError exception thrown if method is not implemented

Specified by:
listSubEntityNames in interface dkEntityDef
Returns:
an array of entity names
Throws:
DKException - if the datastore does not support multi-level entity, i.e. this entity object does not have sub-entities.

add

public void add(dkEntityDef subEntityObj)
         throws DKException,
                java.lang.Exception
Adds the sub entity definition object to the this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
add in interface dkEntityDef
Parameters:
subEntityObj - an sub entity object to be added to this entity object
Throws:
DKException - if there is error in datastore server

del

public void del(dkEntityDef subEntityObj)
         throws DKException,
                java.lang.Exception
Delete the sub entity definition object from this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
del in interface dkEntityDef
Parameters:
subEntityObj - an sub entity object to be deleted from this entity object
Throws:
DKException - if the error occurs in datastore

deleteSubEntity

public void deleteSubEntity(java.lang.String subEntityName)
                     throws DKException,
                            java.lang.Exception
Delete the sub entity definition object from this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
deleteSubEntity in interface dkEntityDef
Parameters:
subEntityName - an sub entity object to be deleted from this entity object
Throws:
DKException - if the error occurs in datastore

addSubEntity

public void addSubEntity(dkEntityDef subEntityObj)
                  throws DKException,
                         java.lang.Exception
Adds the sub entity definition object to the this entity in memory.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
addSubEntity in interface dkEntityDef
Parameters:
subEntityObj - an sub entity object to be added to this entity object
Throws:
DKException - if there is error in datastore server

removeSubEntity

public void removeSubEntity(java.lang.String subEntityName)
                     throws DKException,
                            java.lang.Exception
Removes the sub entity definition object from this entity in memory.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
removeSubEntity in interface dkEntityDef
Parameters:
subEntityName - an sub entity object to be removed from this entity object
Throws:
DKException - if the error occurs in datastore

createAttr

public dkAttrDef createAttr()
                     throws DKException,
                            java.lang.Exception
Creates new dkAttrDef and returns it to caller.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
createAttr in interface dkEntityDef
Returns:
new dkAttrDef object.
Throws:
DKException - if this entity does not have attribute

getAttr

public dkAttrDef getAttr(java.lang.String attrName)
                  throws DKException,
                         java.lang.Exception
Retrieves an attribute object from a given attribute name

Note:DKUsageError exception thrown if method is not implemented

Specified by:
getAttr in interface dkEntityDef
Parameters:
attrName - name of attribute to be retrieved
Returns:
an attribute object
Throws:
DKException - if the attribute name is not exist

retrieveAttr

public dkAttrDef retrieveAttr(java.lang.String attrName)
                       throws DKException,
                              java.lang.Exception
Retrieves an attribute object from a given attribute name from the persistent datastore.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
retrieveAttr in interface dkEntityDef
Parameters:
attrName - name of attribute to be retrieved
Returns:
an attribute object
Throws:
DKException - if the attribute name is not exist

listAttrs

public dkCollection listAttrs()
                       throws DKException,
                              java.lang.Exception
Gets a list of attributes
Specified by:
listAttrs in interface dkEntityDef
Returns:
a dkCollection of dkAttrDef's
Throws:
DKException - if error occurs

listAttrNames

public java.lang.String[] listAttrNames()
                                 throws DKException,
                                        java.lang.Exception
Gets a list of attributes
Specified by:
listAttrNames in interface dkEntityDef
Returns:
an array of attribute names
Throws:
DKException - if error occurs

add

public void add()
         throws DKException,
                java.lang.Exception
Adds this entity definition to the persistent store, i.e. make this entity persistent.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
add in interface dkEntityDef
Throws:
DKException - when the subclass does not implement this method

del

public void del()
         throws DKException,
                java.lang.Exception
Deletes this entity from the persistent store, e.g. drop table. The in-memory copy is not changed.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
del in interface dkEntityDef
Throws:
DKException - when the subclass does not implement this method

add

public void add(dkAttrDef attrObj)
         throws DKException,
                java.lang.Exception
Adds the given attribute definition object to the this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
add in interface dkEntityDef
Parameters:
attrObj - an attribute object to be added to this entity object
Throws:
DKException - if there is error in datastore server

del

public void del(dkAttrDef attrObj)
         throws DKException,
                java.lang.Exception
Deletes the given attribute from this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
del in interface dkEntityDef
Parameters:
attrObj - an attribute object to be deleted from this entity object
Throws:
DKException - if the error occurs in datastore

deleteAttr

public void deleteAttr(java.lang.String attrName)
                throws DKException,
                       java.lang.Exception
Deletes the given attribute from this entity in the persistent store.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
deleteAttr in interface dkEntityDef
Parameters:
attrName - an attribute name to be deleted from this entity object
Throws:
DKException - if the error occurs in datastore

addAttr

public void addAttr(dkAttrDef attrObj)
             throws DKException,
                    java.lang.Exception
Adds the given attribute definition object to the this entity. (memory-only)

Note:DKUsageError exception thrown if method is not implemented

Specified by:
addAttr in interface dkEntityDef
Parameters:
attrObj - an attribute object to be added to this entity object
Throws:
DKException - if there is error in datastore server

removeAttr

public void removeAttr(java.lang.String attrName)
                throws DKException,
                       java.lang.Exception
Removes the given attribute from this entity. (memory-only)

Note:DKUsageError exception thrown if method is not implemented

Specified by:
removeAttr in interface dkEntityDef
Parameters:
attrName - an attribute name to be removed from this entity object
Throws:
DKException - if the error occurs in datastore

isTextSearchable

public boolean isTextSearchable()
Checks if this entity is text searchable
Specified by:
isTextSearchable in interface dkEntityDef
Returns:
true if this entity is text searchable.

setTextSearchable

public void setTextSearchable(boolean textSearchable)
                       throws DKException,
                              java.lang.Exception
Sets this entity to be text searchable
Specified by:
setTextSearchable in interface dkEntityDef
Parameters:
textSearchable - is true if the entity is text searchable

clearCache

public void clearCache()
                throws DKException,
                       java.lang.Exception
Clear entity def cache

Note:DKUsageError exception thrown if method is not implemented

Specified by:
clearCache in interface dkEntityDef

EIP Java APIs

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