Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.search
Class SearchClassSpecification

    java.lang.Object
      oracle.ifs.search.SearchClassSpecification

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

    public final class SearchClassSpecification

extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A SearchClassSpecification represents the FROM and SELECT clauses of select statement. In iFS Searches always return objects and not attributes. So the select list is a list of classes and not attributes.

For each Searched class users can specify whether subclass objects should be included in the search. The default behavior is to include subclass objects and to exclude deleted objects.

Users can also specify aliases for the searched classes. This is needed on joins on the same class. If a user specifies an alias for a class, then the alias must be used in place of the class in all the Qualifiers, SortSpecifications, and ResultClass lists. Using the className in place of the alias will cause IfsException-22701 to be thrown.

The aliases must be unique within a SearchClassSpecification. Also the same class cannot be specified more than once without an alias. This will cause IfsException-22700 to be thrown.

>      // Usage Examples

>      // Here we show combination of default constructor and other mutator
>      // methods. Similar results can be achieved using constructor variants,
>      // which take additional parameters.

>      // Simple search class spec with a single class in it.
>      // The single class acts as the result class also.
>      // Generates Select DOCUMENT.* from DOCUMENT

>      SearchClassSpecification searchClassSpec = new SearchClassSpecification();
>      searchClassSpec.addSearchClass(Document.CLASS_NAME);

>      // Multiple search classes. Remember to use JoinQualification.
>      // Search classes - DOCUMENT, CATEGORY
>      // Result Class - DOCUMENT (picked by default)
>      // SQL - Select DOCUMENT.* from DOCUMENT, CATEGORY
>      SearchClassSpecification searchClassSpec = new SearchClassSpecification();
>      searchClassSpec.addSearchClass(Document.CLASS_NAME);
>      searchClassSpec.addSearchClass(Category.CLASS_NAME);

>      // Overriding the default result class
>      searchClassSpec.addResultClass(Category.CLASS_NAME);

>      // Using aliases for class names. Aliases very useful when having
>      // same search class more than once in the search class specification.
>      // Search Classes - DOCUMENT, CATEGORY
>      // Search class aliases - DOC, CAT
>      // Result Class - DOCUMENT (Picked by default)
>      // SQL - Select DOC.* from DOCUMENT DOC, CATEGORY CAT
>      SearchClassSpecification searchClassSpec = new SearchClassSpecification();
>      searchClassSpec.addSearchClass(Document.CLASS_NAME, "DOC");
>      searchClassSpec.addSearchClass(Category.CLASS_NAME, "CAT");

>      // Set up to remove duplicates
>      searchClassSpec.setDistinct(true);

See Also:
  Serialized Form
(Published)

Field Summary
`protected int` | `m_AliasCounter` Counter used for generating internal Aliases.
`protected java.util.Hashtable` | `m_AliasMap` This maps user specified aliases to classes.
`protected boolean` | `m_DistinctSearch` This indicates if the duplicates will be removed.
`protected java.util.Vector` | `m_ResultClasses` List of Result Classes.
`protected java.util.Vector` | `m_SearchClassEntries` List of Search Class Entries

Constructor Summary
`SearchClassSpecification()` Constructs an empty SearchClassSpecification.
`SearchClassSpecification(java.lang.String[] sClasses)` Construct SearchClassSpecification, initializing with the set of classes supplied in the parameter.
`SearchClassSpecification(java.lang.String[] sClasses, boolean[] delBehavior, boolean[] recBehavior)` Construct SearchClassSpecification, initializing it with the supplied set of classes, delete behavior, and recursive behavior.
`SearchClassSpecification(java.lang.String[] sClasses, java.lang.String[] sAliases, boolean[] delBehavior, boolean[] recBehavior)` Construct SearchClassSpecification, initializing it with the set of supplied classes, aliases, delete behavior, and recursive behavior.

Method Summary
`void` | `addResultClass(java.lang.String name)` Add name to the ResultClass list.
`void` | `addSearchClass(java.lang.String sClass)` Adds the class to the list of Searched Classes.
`void` | `addSearchClass(java.lang.String sClass, boolean delBeh, boolean recBeh)` Adds the class to the list of Searched Classes.
`void` | `addSearchClass(java.lang.String sClass, java.lang.String sAlias)` Adds the class to the list of Searched Classes.
`void` | `addSearchClass(java.lang.String className, java.lang.String aliasName, boolean delBeh, boolean recBeh)` Adds the class to the list of Searched Classes.
`void` | `addSearchClasses(java.lang.String[] sClasses)` Add search classes to list of classes.
`void` | `addSearchClasses(java.lang.String[] sClasses, boolean[] delBeh, boolean[] recBeh)`
`void` | `addSearchClasses(java.lang.String[] sClasses, java.lang.String[] sAliases)` add search classes to list of classes.
`void` | `addSearchClasses(java.lang.String[] sClasses, java.lang.String[] sAliases, boolean[] delBeh, boolean[] recBeh)` Add search classes to list of classes.
`java.lang.Object` | `clone()` Returns a clone of this SearchClassSpecification.
`protected java.lang.String` | `getAlias(java.lang.String name)` Returns the Alias associated with the name.
`java.lang.String` | `getClass(java.lang.String name)` Given the alias/class, it returns the associated Class.
`boolean[]` | `getDeleteBehavior()` Returns delete behavior of classes
`protected java.lang.String` | `getExternalName(int element)` Returns the name used by the user for the ith search class.
`boolean[]` | `getRecursiveBehavior()` Returns recursive behavior of classes
`java.lang.String[]` | `getResultClassnames()` Gets list of result classes
`java.lang.String[]` | `getSearchClassAliases()` Gets list of search aliases.
`java.lang.String[]` | `getSearchClassnames()` Returns list of search classes
`boolean[]` | `getSqlViewUsage()` Returns SQL view usage behavior of classes
`boolean` | `isDistinct()` Get remove duplicates behavior.
`protected void` | `requireSqlView()` Indicate that all classes must use SQL view instead of the table
`protected void` | `requireSqlView(java.lang.String name)` Indicate that the specified alias/class must use SQL view instead of the table
`void` | `setDistinct(boolean isDistinct)` Set remove duplicates behavior.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_SearchClassEntries

    protected java.util.Vector m_SearchClassEntries

  Description copied from class: `SearchClassSpecification`
  List of Search Class Entries

  (Unpublished)

### m_ResultClasses

    protected java.util.Vector m_ResultClasses

  Description copied from class: `SearchClassSpecification`
  List of Result Classes.

  (Unpublished)

### m_AliasMap

    protected java.util.Hashtable m_AliasMap

  Description copied from class: `SearchClassSpecification`
  This maps user specified aliases to classes. If no alias is specified for a class, this maps the class onto itself.

  (Unpublished)

### m_AliasCounter

    protected transient int m_AliasCounter

  Description copied from class: `SearchClassSpecification`
  Counter used for generating internal Aliases.

  (Unpublished)

### m_DistinctSearch

    protected boolean m_DistinctSearch

  Description copied from class: `SearchClassSpecification`
  This indicates if the duplicates will be removed.

  (Unpublished)

Constructor Detail

### SearchClassSpecification

    public SearchClassSpecification()
                             throws IfsException

  Constructs an empty SearchClassSpecification. Class lists are empty.

  Throws:
    `IfsException` - if operation fails.
  (Published)

### SearchClassSpecification

    public SearchClassSpecification(java.lang.String[] sClasses)
                             throws IfsException

  Construct SearchClassSpecification, initializing with the set of classes supplied in the parameter. Calls SearchClassSpecification(sClasses, null, null, null)

  Parameters:
    `sClasses` - list of classes to search over.
  Throws:
    `IfsException` - if operation fails.
  (Published)

### SearchClassSpecification

    public SearchClassSpecification(java.lang.String[] sClasses,
                                    boolean[] delBehavior,
                                    boolean[] recBehavior)
                             throws IfsException

  Construct SearchClassSpecification, initializing it with the supplied set of classes, delete behavior, and recursive behavior. Calls SearchClassSpecification(sClasses, null, delBehavior, recBehavior) The length of arrays for delBehavior and recBehavior should be same as that of searchClasses or arrays themselves should be null.

  Parameters:
    `sClasses` - list of classes to search over.
    `delBehavior` - array of boolean describing delete behavior for each class.
    `recBehavior` - array of boolean describing recursive behavior for each class.
  Throws:
    `IfsException` - if operation fails.
  (Published)

### SearchClassSpecification

    public SearchClassSpecification(java.lang.String[] sClasses,
                                    java.lang.String[] sAliases,
                                    boolean[] delBehavior,
                                    boolean[] recBehavior)
                             throws IfsException

  Construct SearchClassSpecification, initializing it with the set of supplied classes, aliases, delete behavior, and recursive behavior. Length of aliases, delBehavior and recBehavior arrays should match that of the class array or they should be null.

  Parameters:
    `sClasses` - list of classes to search over.
    `sAliases` - Aliases for the classes
    `delBehavior` - array of boolean describing delete behavior for each class.
    `recBehavior` - array of boolean describing recursive behavior for each class.
  Throws:
    `IfsException` - if operation fails.
  (Published)

Method Detail

### addSearchClasses

    public void addSearchClasses(java.lang.String[] sClasses)
                          throws IfsException

  Description copied from class: `SearchClassSpecification`
  Add search classes to list of classes. Calls addSearchClass for each entry in the array.

  Parameters:
    `sClasses` - list of classes.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### addSearchClasses

    public void addSearchClasses(java.lang.String[] sClasses,
                                 java.lang.String[] sAliases)
                          throws IfsException

  Description copied from class: `SearchClassSpecification`
  add search classes to list of classes. Calls addSearchClass for each entry in the array.

  Parameters:
    `sClasses` - list of classes.
    `sAliases` - Aliases for the classes. For unspecified values, alias is assumed to be null.
  Throws:
    `IfsException` - if operation fails.
  (Published)

### addSearchClasses

    public void addSearchClasses(java.lang.String[] sClasses,
                                 boolean[] delBeh,
                                 boolean[] recBeh)
                          throws IfsException

  Throws:
    `IfsException`
  (Unpublished)

### addSearchClasses

    public void addSearchClasses(java.lang.String[] sClasses,
                                 java.lang.String[] sAliases,
                                 boolean[] delBeh,
                                 boolean[] recBeh)
                          throws IfsException

  Description copied from class: `SearchClassSpecification`
  Add search classes to list of classes. Calls addSearchClass for each entry in the array.

  Parameters:
    `sClasses` - list of classes.
    `sAliases` - Aliases for the classes. For unspecified values, alias is assumed to be null.
    `delBeh` - array of boolean describing delete behavior for each class. For unspecified entries delete Behavior is assumed to be false.
    `recBeh` - array of boolean describing recursive behavior for each class. For unspecified entries recursive Behavior is assumed to be true.
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### addSearchClass

    public void addSearchClass(java.lang.String sClass)
                        throws IfsException

  Description copied from class: `SearchClassSpecification`
  Adds the class to the list of Searched Classes.

  Parameters:
    `sClass` - the iFS class being searched
  Throws:
    `IfsException` - if operation fails.
  (Published)

### addSearchClass

    public void addSearchClass(java.lang.String sClass,
                               java.lang.String sAlias)
                        throws IfsException

  Description copied from class: `SearchClassSpecification`
  Adds the class to the list of Searched Classes.

  Parameters:
    `sClass` - the iFS class being searched
    `sAlias` - the Alias for the Class, if this is null an internal alias is generated. User must use ClassName in Quals, SortSpec etc.
  Throws:
    `IfsException` - (IFS-22702) if sClass is null.
  (Published)

### addSearchClass

    public void addSearchClass(java.lang.String sClass,
                               boolean delBeh,
                               boolean recBeh)
                        throws IfsException

  Description copied from class: `SearchClassSpecification`
  Adds the class to the list of Searched Classes. Calls addSearchClass(sClass, null, delBeh, rechBeh)

  Parameters:
    `sClass` - the iFS class being searched
    `delBeh` - boolean describing delete behavior for class.
    `recBeh` - boolean describing recursive behavior for class.
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### addSearchClass

    public void addSearchClass(java.lang.String className,
                               java.lang.String aliasName,
                               boolean delBeh,
                               boolean recBeh)
                        throws IfsException

  Description copied from class: `SearchClassSpecification`
  Adds the class to the list of Searched Classes.

  Parameters:
    `className` - the iFS class being searched
    `aliasName` - the Alias for the Class, if this is null an internal alias is generated. User must use ClassName in Quals, SortSpec etc.
    `delBeh` - boolean describing delete behavior for class.
    `recBeh` - boolean describing recursive behavior for class.
  Throws:
    `IfsException` - (IFS-22702) if sClass is null.
  (Unpublished)

### getSearchClassnames

    public java.lang.String[] getSearchClassnames()

  Description copied from class: `SearchClassSpecification`
  Returns list of search classes

  Returns:
    list of search classes
  (Published)

### getSearchClassAliases

    public java.lang.String[] getSearchClassAliases()
                                             throws IfsException

  Description copied from class: `SearchClassSpecification`
  Gets list of search aliases.

  Returns:
    list of search aliases.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getDeleteBehavior

    public boolean[] getDeleteBehavior()

  Description copied from class: `SearchClassSpecification`
  Returns delete behavior of classes

  Returns:
    delete behavior of classes
  (Unpublished)

### getRecursiveBehavior

    public boolean[] getRecursiveBehavior()

  Description copied from class: `SearchClassSpecification`
  Returns recursive behavior of classes

  Returns:
    recursive behavior of classes
  (Published)

### getSqlViewUsage

    public boolean[] getSqlViewUsage()

  Description copied from class: `SearchClassSpecification`
  Returns SQL view usage behavior of classes

  Returns:
    SQL view usage behavior of classes
  (Unpublished)

### getClass

    public java.lang.String getClass(java.lang.String name)
                              throws IfsException

  Description copied from class: `SearchClassSpecification`
  Given the alias/class, it returns the associated Class.

  Parameters:
    `name` - alias/Class name. If class has an associated alias, specify the alias, otherwise sepcify the className.
  Returns:
    associated className
  Throws:
    `IfsException` - (IFS-22701) if name is not found in internal mapping
  (Unpublished)

### getAlias

    protected java.lang.String getAlias(java.lang.String name)
                                 throws IfsException

  Description copied from class: `SearchClassSpecification`
  Returns the Alias associated with the name. Name can be a class or alias.

  Parameters:
    `name` - alias/Class name. If class has an associated alias, specify the alias, otherwise sepcify the className.
  Returns:
    the associated Alias.
  Throws:
    `IfsException` - (IFS-22701) if name is not found in internal mapping
  (Unpublished)

### requireSqlView

    protected void requireSqlView()
                           throws IfsException

  Description copied from class: `SearchClassSpecification`
  Indicate that all classes must use SQL view instead of the table

  Throws:
    `IfsException` - upon any failure
  (Unpublished)

### requireSqlView

    protected void requireSqlView(java.lang.String name)
                           throws IfsException

  Description copied from class: `SearchClassSpecification`
  Indicate that the specified alias/class must use SQL view instead of the table

  Parameters:
    `name` - alias/Class name. If class has an associated alias, specify the alias, otherwise sepcify the className.
  Throws:
    `IfsException` - (IFS-22701) if name is not found in internal mapping
  (Unpublished)

### getExternalName

    protected java.lang.String getExternalName(int element)

  Description copied from class: `SearchClassSpecification`
  Returns the name used by the user for the ith search class. For classes w/o aliases, it is the className, else it is the alias.

  Parameters:
    `element` - class index
  Returns:
    name used for ith Search Class.
  (Unpublished)

### addResultClass

    public void addResultClass(java.lang.String name)
                        throws IfsException

  Description copied from class: `SearchClassSpecification`
  Add name to the ResultClass list. Name must be a user specified alias or classname.

  Parameters:
    `name` - For classes w/o aliases, this should be the className; o.w. this should be the alias.
  Throws:
    `IfsException` - (IFS-22702) if name is not valid
  (Published)

### getResultClassnames

    public java.lang.String[] getResultClassnames()
                                           throws IfsException

  Description copied from class: `SearchClassSpecification`
  Gets list of result classes

  Returns:
    list of result classes
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setDistinct

    public void setDistinct(boolean isDistinct)
                     throws IfsException

  Description copied from class: `SearchClassSpecification`
  Set remove duplicates behavior.

  Parameters:
    `isDistinct` - if true, add DISTINCT to select clause.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### isDistinct

    public boolean isDistinct()
                       throws IfsException

  Description copied from class: `SearchClassSpecification`
  Get remove duplicates behavior.

  Returns:
    true if set, false otherwise.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### clone

    public java.lang.Object clone()

  Description copied from class: `SearchClassSpecification`
  Returns a clone of this SearchClassSpecification.

  Overrides:
    `clone` in class `java.lang.Object`
  Returns:
    Return a clone of this SearchClassSpecification.
  (Published)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD