Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class DKQSubExpr

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.DKQSubExpr
All Implemented Interfaces:
java.io.Serializable

public class DKQSubExpr
extends java.lang.Object
implements java.io.Serializable

A sub-query DKQSubExpr expression consists of entity-names, a display-list, a query term, an option list, and an optional parameter list. A query expression DKQExpr may contains one or more sub-expressions, each sub-expression essentially defines a sub-query. When the query is executed, each sub-query will be executed and the results will be OR-ed together to form a result for the whole query. Digital Library datastore supports sub-queries as described above, but not all datastores support sub-queries. In such a case, there will bw only one sub-query.

See Also:
Serialized Form

Constructor Summary
DKQSubExpr()
          Default constructor without a parameter.
 
Method Summary
 java.lang.String getAssociatedEntityName()
          Gets the associated entity name associated with this query This entity will support text and parametric query
 java.lang.String[] getDisplayList()
          Gets the display-list in this query.
 java.lang.String getEntityName()
          Gets the entity-name specified in this query.
 java.lang.String[] getEntityNames()
          Gets the entity-names in this query; there are more than one entity-names.
 java.lang.String getMappingName()
          Gets the optional schema mapping name for executing this query.
 int getMappingType()
          Gets the optional schema mapping type for executing this query.
 DKNVPair getOption(int position)
          Gets an option at the given position.
 DKNVPair getOption(java.lang.String name)
          Gets an option with a given name.
 DKNVPair[] getOptionList()
           
 DKNVPair getParameter(int position)
          Gets a parameter at a given position.
 DKNVPair getParameter(java.lang.String name)
          Gets a parameter with a given name.
 DKNVPair[] getParameterList()
           
 DKQTerm getQueryTerm()
          Gets the query term or condition part of this query.
 boolean isTranslation()
          Check if this query requires schema translation using schema mapping.
 int optionCount()
          Gets the number of defined options.
 int parameterCount()
          Gets the number of defined parameters.
 void removeOption(int position)
          Removes the option at the given position.
 int removeOption(java.lang.String name)
          Removes the option with the given name.
 void removeParameter(int position)
          Removes the parameter at the given position.
 int removeParameter(java.lang.String name)
          Removes the parameter with the given name.
 void setAssociatedEntityName(java.lang.String assocEntityName)
          Sets the associated entity name associated with this query This entity will support text and parametric query
 void setDisplayList(java.lang.String[] names)
          Sets the display-list in this query.
 void setEntityName(java.lang.String name)
          Sets the entity-name in this query.
 void setEntityNames(java.lang.String[] names)
          Sets the entity-names in this query; there are more than one entity-names.
 void setMappingName(java.lang.String mappingName)
          Sets the optional schema mapping name for executing this query.
 void setMappingType(int mappingType)
          Sets the optional schema mapping type for executing this query.
 void setOption(int position, DKNVPair optionPair)
          Sets the option at the given position.
 int setOption(java.lang.String name, java.lang.Object value)
          Sets the option with the given name.
 void setOptionList(DKNVPair[] optionList)
           
 void setParameter(int position, DKNVPair parmPair)
          Sets the parameter at the given position.
 int setParameter(java.lang.String name, java.lang.Object value)
          Sets a parameter with a given name.
 void setParameterList(DKNVPair[] parameterList)
           
 void setQueryTerm(DKQTerm qTerm)
          Sets the query term or condition part in this query.
 void setTranslation(boolean translation)
          Sets the requirement for schema translation for this query.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKQSubExpr

public DKQSubExpr()
Default constructor without a parameter.
Method Detail

getEntityName

public java.lang.String getEntityName()
Gets the entity-name specified in this query. Assumes that there is only one entity involved.
Returns:
the entity name, or null if the entity-name is not initialized.

setEntityName

public void setEntityName(java.lang.String name)
Sets the entity-name in this query. Assumes that there is only one entity involved in this query.
Parameters:
the - entity name.

getAssociatedEntityName

public java.lang.String getAssociatedEntityName()
Gets the associated entity name associated with this query This entity will support text and parametric query
Returns:
name of associated entity name

setAssociatedEntityName

public void setAssociatedEntityName(java.lang.String assocEntityName)
Sets the associated entity name associated with this query This entity will support text and parametric query
Parameters:
assocEntityName - associated entity name

getEntityNames

public java.lang.String[] getEntityNames()
Gets the entity-names in this query; there are more than one entity-names. For example, a text query may have more than one entity or search-indices specified.
Returns:
a string array of entity names, or null if the entity-name is not initialized.

setEntityNames

public void setEntityNames(java.lang.String[] names)
Sets the entity-names in this query; there are more than one entity-names.
Parameters:
values - a string array of entity names.

getMappingName

public java.lang.String getMappingName()
Gets the optional schema mapping name for executing this query. The default value is null, which means mapping is not required.
Returns:
the mapping name.

setMappingName

public void setMappingName(java.lang.String mappingName)
Sets the optional schema mapping name for executing this query.
Parameters:
mappingName - the mapping name

getMappingType

public int getMappingType()
Gets the optional schema mapping type for executing this query. The default value is 0, which means mapping is not required. Valid values are: DK_FED_MAPPED_ENTITY, DK_FED_MAPPED_TEXT_ENTITY, etc
Returns:
the mapping type.

setMappingType

public void setMappingType(int mappingType)
Sets the optional schema mapping type for executing this query.
Parameters:
mappingName - the mapping name
See Also:
getMappingType()

isTranslation

public boolean isTranslation()
Check if this query requires schema translation using schema mapping.
Returns:
true if schema translation is required.

setTranslation

public void setTranslation(boolean translation)
Sets the requirement for schema translation for this query. Schema mapping name must by provided via setMappingName() method.
Parameters:
translation - true or false.
See Also:
isTranslation(), setMappingName(java.lang.String)

getDisplayList

public java.lang.String[] getDisplayList()
Gets the display-list in this query. The display-list is a list of search attribute-names to be displayed in the results of this query. If it is not specified, all attributes will be selected.
Returns:
a string array of attribute-names, or null if display-list is not initialized.

setDisplayList

public void setDisplayList(java.lang.String[] names)
Sets the display-list in this query.
Parameters:
names - a string array of attribute-names.
See Also:
getDisplayList()

getQueryTerm

public DKQTerm getQueryTerm()
Gets the query term or condition part of this query.
Returns:
a DKQTerm object

setQueryTerm

public void setQueryTerm(DKQTerm qTerm)
Sets the query term or condition part in this query.
Parameters:
a - DKQTerm object

optionCount

public int optionCount()
Gets the number of defined options.
Returns:
integer number of options

getOptionList

public DKNVPair[] getOptionList()

setOptionList

public void setOptionList(DKNVPair[] optionList)

getOption

public DKNVPair getOption(int position)
Gets an option at the given position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

getOption

public DKNVPair getOption(java.lang.String name)
Gets an option with a given name.
Returns:
the option with the given name; or null if it is not found.

setOption

public void setOption(int position,
                      DKNVPair optionPair)
Sets the option at the given position.
Parameters:
optionPair - the new option
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

setOption

public int setOption(java.lang.String name,
                     java.lang.Object value)
Sets the option with the given name. The option will be added, if it does not exist yet.
Returns:
the position of the option

removeOption

public void removeOption(int position)
Removes the option at the given position.
Parameters:
the - position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

removeOption

public int removeOption(java.lang.String name)
Removes the option with the given name.
Parameters:
name - the option name.
Returns:
the position; -1 if not found.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

parameterCount

public int parameterCount()
Gets the number of defined parameters.
Returns:
integer number of parameters

getParameterList

public DKNVPair[] getParameterList()

setParameterList

public void setParameterList(DKNVPair[] parameterList)

getParameter

public DKNVPair getParameter(int position)
Gets a parameter at a given position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

getParameter

public DKNVPair getParameter(java.lang.String name)
Gets a parameter with a given name.
Returns:
the option with the given name; or null if it is not found.

setParameter

public void setParameter(int position,
                         DKNVPair parmPair)
Sets the parameter at the given position.
Parameters:
parmPair - the new parameter
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

setParameter

public int setParameter(java.lang.String name,
                        java.lang.Object value)
Sets a parameter with a given name. The parameter will be added, if it does not exist yet.
Returns:
the position of the parameter

removeParameter

public void removeParameter(int position)
Removes the parameter at the given position.
Parameters:
the - position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

removeParameter

public int removeParameter(java.lang.String name)
Removes the parameter with the given name.
Parameters:
name - the parameter name.
Returns:
the position; -1 if not found.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

EIP Java APIs

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