Oracle Content Management SDK

oracle.ifs.search
Class ExistenceQualification

java.lang.Object
  |
  +--oracle.ifs.search.SearchQualification
        |
        +--oracle.ifs.search.ExistenceQualification
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ExistenceQualification
extends SearchQualification

ExistenceQualification represents a Simple Sub Query. This qualification provides a way to specify a search an attribute value match against a list of values. On the left hand side of this qualification is any scalar attribute of a iFS class. We do not support array attributes as of current release. On the right hand side the list of values could come from any iFS attriute (scalar or array type) or from a user supplied AttributeValue array.

 //
 // Usage Examples
 //
 // Simple sub query example. Suppose you want to look for,
 // All documents whose name appears in STRINGVALUE attribute of any PROPERTY
 // Generates query  - DOCUMENT.Name in (select STRINGVALUE from PROPERTY)
 // This shows scalar attributes on both LHS and RHS.
 //
 ExistenceQualification eq1 = new ExistenceQualification();
 eq1.setLeftAttribute(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE); 
 eq1.setRightAttribute(Property.CLASS_NAME, Property.STRINGVALUE_ATTRIBUTE); 
 //
 // Using the a array type attribute on the right hand side
 // Suppose you want to look for, all documents whose name appears in
 // STRINGVALUES array type attribute in a property.
 // Generates query - DOCUMENT.Name in (select STRINGVALUES[] from PROPERTY)
 // This flattens out the array attribute on the right hand side and generates
 // a concatenated list of all values in STRINGVALUES attribute in each row.
 //
 ExistenceQualification eq1 = new ExistenceQualification();
 eq1.setLeftAttribute(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE); 
 eq1.setRightAttribute(Property.CLASS_NAME, Property.STRINGVALUES_ATTRIBUTE); 
 //
 // User supplied AttributeValues on the RHS
 // Suppose you want to look for documents whose name is in {"FOO", "BAR", "NOTES"},
 // then you use the EQ in the following manner.
 //
 // First generate the list of values.
 AttributeValue [] avArray = new AttributeValue[3];
 avArray[0] = AttributeValue.newAttributeValue("FOO");
 avArray[1] = AttributeValue.newAttributeValue("BAR");
 avArray[2] = AttributeValue.newAttributeValue("NOTES");
 //
 // Then use the list in a EQ.
 ExistenceQualification eq1 = new ExistenceQualification();
 eq1.setLeftAttribute(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE); 
 eq1.setRightAttributeValue(avArray); 

 

See Also:
Serialized Form

Fields inherited from class oracle.ifs.search.SearchQualification
LATE_BIND_OPER
 
Constructor Summary
ExistenceQualification()
          Constructs an existence qualification.
 
Method Summary
 java.lang.String getLeftAttributeName()
          Gets the left hand side Attribute name.
 java.lang.String getLeftClassname()
          Gets the left hand side class name.
 java.lang.String getRightAttributeName()
          Gets the right hand side Attribute name.
 AttributeValue[] getRightAttributeValue()
          Gets up the Attribute value array for the right hand side.
 java.lang.String getRightClassname()
          Gets the Right hand side class name.
 boolean isRightAttributeValue()
          Gets true if the ExistenceQualification was constructed by supplying an Attribute Value array for RHS.
 void setLeftAttribute(java.lang.String classname, java.lang.String attribute)
          Sets the left hand side class and attribute name of this qualification.
 void setRightAttribute(java.lang.String classname, java.lang.String attribute)
          Sets the right hand side class and attribute name of this qualification.
 void setRightAttributeValue(AttributeValue[] avArray)
          Sets up the Attribute value array for the right hand side.
 

Constructor Detail


ExistenceQualification

public ExistenceQualification()
                       throws IfsException
Constructs an existence qualification.
Throws:
IfsException - if the operation fails
Method Detail

setLeftAttribute

public void setLeftAttribute(java.lang.String classname,
                             java.lang.String attribute)
                      throws IfsException
Sets the left hand side class and attribute name of this qualification. The class name used here should be one of the search classes.
Parameters:
class - left hand side class name
attribute - left hand side attribute name
Throws:
IfsException - if the operation fails

setRightAttribute

public void setRightAttribute(java.lang.String classname,
                              java.lang.String attribute)
                       throws IfsException
Sets the right hand side class and attribute name of this qualification. The class used here need not be in the list of search classes because, it is used in a separate sub query.
Parameters:
class - right hand side class name
attribute - right hand side attribute name
Throws:
IfsException - if the operation fails

setRightAttributeValue

public void setRightAttributeValue(AttributeValue[] avArray)
                            throws IfsException
Sets up the Attribute value array for the right hand side. Use this method to set up user supplied values for the right hand side.
Parameters:
avArray - array of attribute values
Throws:
IfsException - if the operation fails

getRightAttributeValue

public AttributeValue[] getRightAttributeValue()
                                        throws IfsException
Gets up the Attribute value array for the right hand side.
Returns:
array of attribute values
Throws:
IfsException - if the operation fails

getLeftClassname

public java.lang.String getLeftClassname()
                                  throws IfsException
Gets the left hand side class name.
Returns:
Name of the left hand side iFS class.
Throws:
IfsException - if the operation fails

getRightClassname

public java.lang.String getRightClassname()
                                   throws IfsException
Gets the Right hand side class name.
Returns:
Name of the right hand side iFS class.
Throws:
IfsException - if the operation fails

getLeftAttributeName

public java.lang.String getLeftAttributeName()
                                      throws IfsException
Gets the left hand side Attribute name.
Returns:
Name of the left hand side attribute.
Throws:
IfsException - if the operation fails

getRightAttributeName

public java.lang.String getRightAttributeName()
                                       throws IfsException
Gets the right hand side Attribute name.
Returns:
Name of the right hand side attribute.
Throws:
IfsException - if the operation fails

isRightAttributeValue

public boolean isRightAttributeValue()
                              throws IfsException
Gets true if the ExistenceQualification was constructed by supplying an Attribute Value array for RHS.
Returns:
boolean True if the RHS list is a AV[] supplied by user.
Throws:
IfsException - if the operation fails

Oracle Content Management SDK

(c) 2002 Copyright Oracle Corporation. All rights reserved.