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 SearchSpecification

    java.lang.Object
      oracle.ifs.search.SearchSpecification

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

Direct Known Subclasses:
  AttributeSearchSpecification

    public abstract class SearchSpecification

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

A SearchSpecification defines a Search. It contains all the elements that define a Search, namely SearchClassSpecification, SearchSortSpecification and SearchQualification. The Search and SearchObject deal with SearchSpecification objects. Currently there are two kinds of SearchSpecifications AttributeSearchSpecifications and ContextSearchSpecifications.

Below is an example of how to do a simple content search, using a ContextSearchSpecification.

>      // specify sort order
>      String [] ctxClauseName = {"Test1"};     // order by SCORE
>      // set DESCENDING sort order
>      boolean [] sortOrders = {false};
>      //
>      SearchSortSpecification sortSpec =
>        new SearchSortSpecification(new String[] {"DOCUMENT"}, new String[]
>                                    {ContextQualification.ORDER_PREFIX + "." +
>                                    ctxClauseName[0]}, sortOrders);
>      //
>      // create a query expression using interMedia Text query syntax
>      String searchWord1 = "hierarchy";
>      String searchWord2 = "interfaces";
>      String queryOperator = " & ";
>      String queryExpr = searchWord1 + queryOperator + searchWord2;
>      //
>      // create a ContextQualification and specify the query expression
>      ContextQualification cq = new ContextQualification();
>      cq.setQuery( "?" );
>      cq.setName(ctxClauseName[0]);
>      //
>      // now join with CONTENTOBJECT
>      JoinQualification jq = new JoinQualification();
>      jq.setLeftAttribute("DOCUMENT", "CONTENTOBJECT");
>      jq.setRightAttribute("CONTENTOBJECT", null);
>      //
>      SearchClause sc = new SearchClause( cq, jq, SearchClause.AND );
>      //
>      ContextSearchSpecification cp = new ContextSearchSpecification();
>      cp.setContextClassname("CONTENTOBJECT");
>      cp.setSearchClassSpecification(new SearchClassSpecification(new String[]
>                             {"DOCUMENT", "CONTENTOBJECT"}));
>      cp.setSearchQualification(sc);
>      cp.setSearchSortSpecification(sortSpec);
>      //
>      Search s = new Search(sess, cp);
>      //
>      AttributeValue[] bindValue = new AttributeValue[1];
>      bindValue[0] = AttributeValue.newAttributeValue( queryExpr );
>      //
>      s.open(bindValue);
>      ...
>      s.close();

See Also:
  `AttributeSearchSpecification`, `ContextSearchSpecification`, `Search`, `SearchObject`, Serialized Form
(Published)

Field Summary
`static java.lang.String` | `CLEAR_PLAN_TABLE_PARAMETER` Parameter name for specifying whether rows from plan_table should be cleared after explain plan.
`protected boolean` | `m_SecurityBindingInPlace` Security Clause parameters behavior.
`static java.lang.String` | `PLAN_NAME_PARAMETER` Parameter name for specifying the plan name.
`static java.lang.String` | `PLAN_TABLE_PARAMETER` Default Plan Table to use for explain Plan
`static java.lang.String` | `SEARCH_ID_PARAMETER` Parameter name for id of Search Object.
`static java.lang.String` | `SEARCH_SPEC_PARAMETER` Parameter name for Search Specification

Constructor Summary
`SearchSpecification()`

Method Summary
`protected abstract void` | `bindValuesInPlace(oracle.ifs.search.BindValuesInSpecVisitor vis)` bindValuesInPlace- sets the bind Values in the SearchTree.
`java.lang.Object` | `clone()` Returns a clone of this SearchQualification.
`java.lang.String[]` | `contentClasses()` Return the list of classes on which the readAcces check must be performed.
`void` | `createView(S_LibrarySession sess, ViewSpecification vsp)` Creates a database view based on this Specification, and the ViewSpecification.
`java.lang.String` | `explainPlan(S_Search srchObj, S_LibrarySession sess, java.util.Hashtable planDetails)` Returns the Query Plan for the Search.
`SearchSpecification` | `getBoundSpecification(LibrarySession sess, AttributeValue[] bindValues)` This Specification is cloned and the input bind Values are bound in place in the cloned Specification.
`java.util.Hashtable` | `getContextScoreMap()` Returns a mapping from SCORE expression numbers to ContextQualifier names.
`abstract java.lang.String[]` | `getResultClasses()` Returns all Result Classes
`abstract SearchClassSpecification` | `getSearchClassSpecification()` Returns the SearchClassSpecification associated with this SearchSpecification.
`java.util.Enumeration` | `getSQL(S_Search srchObj, S_LibrarySession s)` Returns the SQL for this Specification.
`java.util.Enumeration` | `getSQL(S_Search srchObj, S_LibrarySession s, java.util.Vector avs, boolean searchCountOnly)` Returns the SQL for this Specification.
`protected abstract java.util.Enumeration` | `getSQL(java.lang.String prefix, S_Search srchObj, S_LibrarySession sess, java.util.Vector avs, boolean searchCountOnly)` Returns the SQL for this Specification.
`abstract java.lang.String` | `getSQLString(java.lang.String prefix, S_LibrarySession session, boolean searchCountOnly)` Returns the SQL string for this SearchSpecification.
`protected abstract java.lang.String` | `getViewStatement(ViewSpecification vsp, S_LibrarySession sess)` Generates a View creation statement, based on the ViewSpecification.
`abstract void` | `validate(LibrarySession s)` This function validates the Specification in a LibrarySession.

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

Field Detail

### PLAN_TABLE_PARAMETER

    public static final java.lang.String PLAN_TABLE_PARAMETER

  Description copied from class: `SearchSpecification`
  Default Plan Table to use for explain Plan

  See Also:
    Constant Field Values
  (Unpublished)

### PLAN_NAME_PARAMETER

    public static final java.lang.String PLAN_NAME_PARAMETER

  Description copied from class: `SearchSpecification`
  Parameter name for specifying the plan name.

  See Also:
    Constant Field Values
  (Unpublished)

### CLEAR_PLAN_TABLE_PARAMETER

    public static final java.lang.String CLEAR_PLAN_TABLE_PARAMETER

  Description copied from class: `SearchSpecification`
  Parameter name for specifying whether rows from plan_table should be cleared after explain plan.

  See Also:
    Constant Field Values
  (Unpublished)

### SEARCH_ID_PARAMETER

    public static final java.lang.String SEARCH_ID_PARAMETER

  Description copied from class: `SearchSpecification`
  Parameter name for id of Search Object.

  See Also:
    Constant Field Values
  (Unpublished)

### SEARCH_SPEC_PARAMETER

    public static final java.lang.String SEARCH_SPEC_PARAMETER

  Description copied from class: `SearchSpecification`
  Parameter name for Search Specification

  See Also:
    Constant Field Values
  (Unpublished)

### m_SecurityBindingInPlace

    protected boolean m_SecurityBindingInPlace

  Description copied from class: `SearchSpecification`
  Security Clause parameters behavior. If true, security clause values are bound in place, else sql binding is used. Default behavior is sql binding.

  (Unpublished)

Constructor Detail

### SearchSpecification

    public SearchSpecification()

(Unpublished)

Method Detail

### validate

    public abstract void validate(LibrarySession s)
                           throws IfsException

  Description copied from class: `SearchSpecification`
  This function validates the Specification in a LibrarySession. Typically it will be called when a SearchObjectDefinition is resolved, before being sent to the server. Examples of validation are check if the Search Classes in an Attribute Search, check if an AttributeQualification is valid in an Attribute Search etc.

  Parameters:
    `s` - LibrarySession to use for validating Search elements.
  Throws:
    `IfsException` - if validation fails
  See Also:
    `SearchValidator`
  (Unpublished)

### getSQL

    public java.util.Enumeration getSQL(S_Search srchObj,
                                        S_LibrarySession s)
                                 throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the SQL for this Specification. Returns an Enumeration of PreparedStatements. The SQL is generated in the Context of a LibrarySession and a Search Object. Calls getSQL(srchObj, s, null)

  Parameters:
    `srchObj` - server-side Search Object
    `s` - server-side session
  Returns:
    list of PreparedStatements
  Throws:
    `IfsException` - if sql generation fails
  See Also:
    `SearchSpecification.getSQL(String, S_Search, S_LibrarySession, Vector, boolean)`
  (Unpublished)

### getSQL

    public java.util.Enumeration getSQL(S_Search srchObj,
                                        S_LibrarySession s,
                                        java.util.Vector avs,
                                        boolean searchCountOnly)
                                 throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the SQL for this Specification. Returns an Enumeration of PreparedStatements. The SQL is generated in the Context of a LibrarySession and a Search Object. Calls getSQL(null, srchObj, s, null)

  Parameters:
    `srchObj` - server-side Search Object
    `s` - server-side session
    `avs` - list of bind Values
  Returns:
    list of PreparedStatements
  Throws:
    `IfsException` - if sql generation fails
  See Also:
    `SearchSpecification.getSQL(String, S_Search, S_LibrarySession, Vector, boolean)`
  (Unpublished)

### getSQL

    protected abstract java.util.Enumeration getSQL(java.lang.String prefix,
                                                    S_Search srchObj,
                                                    S_LibrarySession sess,
                                                    java.util.Vector avs,
                                                    boolean searchCountOnly)
                                             throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the SQL for this Specification. Returns an Enumeration of PreparedStatements. The SQL is generated in the Context of a LibrarySession and a Search Object.

  Parameters:
    `prefix` - sql generated is prefixed with this String. Used during explain plan.
    `srchObj` - server-side Search Object
    `sess` - server-side session
    `avs` - list of bind Values
    `searchCountOnly` -
  Returns:
    list of PreparedStatements
  Throws:
    `IfsException` - if sql generation fails
  See Also:
    `SearchSpecification.getSQL(String, S_Search, S_LibrarySession, Vector, boolean)`
  (Unpublished)

### getSQLString

    public abstract java.lang.String getSQLString(java.lang.String prefix,
                                                  S_LibrarySession session,
                                                  boolean searchCountOnly)
                                           throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the SQL string for this SearchSpecification.

  Parameters:
    `prefix` - sql generated is prefixed with this String. Used during explain plan.
    `session` - server-side session
    `searchCountOnly` - if true, it generates a count(*) in select.
  Returns:
    the SQL generated for this specification.
  Throws:
    `IfsException` - if the operation fails.
  (Unpublished)

### explainPlan

    public java.lang.String explainPlan(S_Search srchObj,
                                        S_LibrarySession sess,
                                        java.util.Hashtable planDetails)
                                 throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the Query Plan for the Search. The user can specify the plan details in a Hashtable. Currently supported parameters are the planTable to use, the statement-id and wether the table should be cleared after the plan is generated. The bind values are also in this table.
  The returned string is the concatenation of rows generated by running the following query: `select lpad(' ', 2*level) || operation || ':' || options || ' ' || object_name || ':' || object_instance || ':' || object_type || ' ' || '(' || cost || ', ' || cardinality || ', ' || bytes ') ' || '(' || partition_start || ', ' || partition_stop || ', ' || partition_id ')' from PLAN_TABLE where statement_id = PLANNAME` start with id = 1 connect by prior id = parent_id

  Parameters:
    `srchObj` - Associated SearchObject
    `sess` - LibrarySession
    `planDetails` - Hashtable containing Plan parameters.
  Returns:
    query plan as a String.
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### getViewStatement

    protected abstract java.lang.String getViewStatement(ViewSpecification vsp,
                                                         S_LibrarySession sess)
                                                  throws IfsException

  Description copied from class: `SearchSpecification`
  Generates a View creation statement, based on the ViewSpecification.

  Parameters:
    `vsp` - details about the View for which the creation statement is to be generated.
    `sess` - server-side session.
  Returns:
    String containing SQL to create the view
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### createView

    public void createView(S_LibrarySession sess,
                           ViewSpecification vsp)
                    throws IfsException

  Description copied from class: `SearchSpecification`
  Creates a database view based on this Specification, and the ViewSpecification. The ViewSpecification specifies the characteristics of the view other than the select statement. This Specifications Select statement is used as the view's select.

  Parameters:
    `sess` - server-side session.
    `vsp` - view details
  Throws:
    `IfsException` - if operation fails
  (Unpublished)

### getResultClasses

    public abstract java.lang.String[] getResultClasses()
                                                 throws IfsException

  Description copied from class: `SearchSpecification`
  Returns all Result Classes

  Throws:
    `IfsException`
  (Published)

### getSearchClassSpecification

    public abstract SearchClassSpecification getSearchClassSpecification()
                                                                  throws IfsException

  Description copied from class: `SearchSpecification`
  Returns the SearchClassSpecification associated with this SearchSpecification.

  Returns:
    SearchClassSpecification associated with this SearchSpecification.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getContextScoreMap

    public java.util.Hashtable getContextScoreMap()
                                           throws IfsException

  Description copied from class: `SearchSpecification`
  Returns a mapping from SCORE expression numbers to ContextQualifier names.

  Returns:
    mapping as a Hashtable.
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### contentClasses

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

  Description copied from class: `SearchSpecification`
  Return the list of classes on which the readAcces check must be performed.

  Returns:
    list of classes
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### getBoundSpecification

    public SearchSpecification getBoundSpecification(LibrarySession sess,
                                                     AttributeValue[] bindValues)
                                              throws IfsException

  Description copied from class: `SearchSpecification`
  This Specification is cloned and the input bind Values are bound in place in the cloned Specification.

  Parameters:
    `sess` - session used for binding values
    `bindValues` - bind Values for SearchTree
  Returns:
    cloned SearchSpecification with bind Values bound in place
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### bindValuesInPlace

    protected abstract void bindValuesInPlace(oracle.ifs.search.BindValuesInSpecVisitor vis)
                                       throws IfsException

  Description copied from class: `SearchSpecification`
  bindValuesInPlace- sets the bind Values in the SearchTree. This is currently used for creating SQL Views.

  Parameters:
    `vis` - BindValues Visitor
  Throws:
    `IfsException` - if operation fails.
  (Unpublished)

### clone

    public java.lang.Object clone()

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

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

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