Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Interface dkEntityDef

All Known Implementing Classes:
dkAbstractEntityDef

public interface dkEntityDef

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.


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)
          Gets an attribute object from a given attribute name (memory-only)
 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 isTextSearchable)
          Sets this entity to be text searchable
 void setType(short entityType)
          Sets type of this entity
 

Method Detail

setDatastore

public void setDatastore(dkDatastore ds)
Sets the reference to the owner datastore object
Parameters:
ds - datastore

getDatastore

public dkDatastore getDatastore()
Gets the reference to the owner datastore object
Returns:
the dkDatastore object

datastoreName

public java.lang.String datastoreName()
                               throws java.lang.Exception
Gets the name of this datastore object.
Returns:
datastore name

datastoreType

public java.lang.String datastoreType()
                               throws java.lang.Exception
Gets the type for this datastore object
Returns:
datastore type

getName

public java.lang.String getName()
Gets entity name
Returns:
name of this entity

setName

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

getType

public short getType()
Gets type of this entity
Returns:
entity type

setType

public void setType(short entityType)
Sets type of this entity
Parameters:
entityType - entity type

getDescription

public java.lang.String getDescription()
Get the description of this entity
Returns:
string containing description.

setDescription

public void setDescription(java.lang.String desc)
Sets description of this entity
Parameters:
desc - description about this entity

isSearchable

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

hasSubEntities

public boolean hasSubEntities()
                       throws DKException,
                              java.lang.Exception
Checks if this entity has sub entity objects
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

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
Returns:
parent entity name.

setParentEntityName

public void setParentEntityName(java.lang.String parentEntityName)
Sets the parent entity name
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

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

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

Note:DKUsageError exception thrown if method is not implemented

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

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

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

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

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

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

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

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
Gets an attribute object from a given attribute name (memory-only)

Note:DKUsageError exception thrown if method is not implemented

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

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
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
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

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

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

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

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

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

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

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
Returns:
true if this entity is text searchable.

setTextSearchable

public void setTextSearchable(boolean isTextSearchable)
                       throws DKException,
                              java.lang.Exception
Sets this entity to be text searchable
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


EIP Java APIs

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