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.beans
Class PreparedSelector

    java.lang.Object
      oracle.ifs.beans.PreparedSelector

Direct Known Subclasses:
  TiePreparedSelector

    public class PreparedSelector

extends java.lang.Object

A PreparedSelector class is used to perform a simple search using a cached PreparedStatement, and optionally using bind variables.

(Unpublished)

Field Summary
`static java.lang.String` | `DEFAULT_ALIAS` The default search alias.

Constructor Summary
`PreparedSelector(LibrarySession session)` Constructs a PreparedSelector.

Method Summary
`protected void` | `applySortSpecificationDefaults()` Applies the primary search target settings as the default class/alias for the current sort specification.
`protected java.lang.String` | `getAliasFromTarget(AttributeValue target)` Returns the alias name from the specified search target.
`static java.lang.String` | `getAliasFromTarget(LibrarySessionInterface session, AttributeValue target)` Returns the alias name from the specified search target.
`AttributeValue[]` | `getAuxiliarySearchTargets()` Returns the auxiliary search targets.
`AttributeValue[]` | `getBindValues()` Gets the bind values to use in the select statement.
`protected java.lang.String` | `getClassFromTarget(AttributeValue target)` Returns the class name from the specified search target.
`static java.lang.String` | `getExistsSecurityClause(java.lang.String alias, java.lang.String attrName)` Return a condition that can be used to restrict results based on the user's ability to discover the object referred to by an attribute.
`java.lang.String` | `getHint()` Gets the SQL hint to use for the main select.
`int` | `getItemCount()` Returns the search result count.
`LibraryObject[]` | `getItems()` Returns the entire search results as an array.
`int` | `getMaxItemCount()` Returns the maximum number of items that will be returned by `getItems`.
`java.lang.String` | `getPrimarySearchAlias()` Returns the alias used for the primary search class.
`java.lang.String` | `getPrimarySearchClass()` Returns the search class that was previously set.
`AttributeValue` | `getPrimarySearchTarget()` Returns the primary search target.
`java.lang.String` | `getSearchLanguage()` Returns the search language in effect.
`java.lang.String` | `getSearchSelection()` Returns the search selection that was set using setSearchSelection()
`LibrarySession` | `getSession()` Returns the session being used by this Selector.
`SortSpecification` | `getSortSpecification()` Returns the Sort Specification.
`java.lang.String[]` | `getSqlStatement()` Gets the SQL statement that will be used.
`int` | `getStartingRowNumber()` Returns the starting row number.
`java.lang.String` | `getStatementKey()` Returns the statement key.
`static java.lang.String` | `getViewFromTarget(LibrarySessionInterface session, AttributeValue target)` Returns the overridden view name from the specified search target.
`boolean` | `isDistinct()` Returns true if distinct searching is enabled with respect to classes.
`boolean` | `isRecursiveSearch()` Returns true if recursive searching is enabled with respect to classes.
`void` | `setAuxiliarySearchTargets(AttributeValue[] targets)` Sets the auxiliary search targets.
`void` | `setBindValues(AttributeValue[] bindValues)` Sets the bind values to use in the select statement.
`void` | `setDistinct(boolean distinct)` Sets the indication as to whether a "select distinct" will be used.
`void` | `setHint(java.lang.String hint)` Sets the SQL hint to use for the main select.
`void` | `setMaxItemCount(int maxItemCount)` Sets the maximum number of items that will be returned by `getItems`.
`void` | `setPrimarySearchClass(java.lang.String className)` Sets the primary search target, specifying the class name only.
`void` | `setPrimarySearchTarget(AttributeValue target)` Sets the primary search target.
`void` | `setRecursiveSearch(boolean recursive)` Enables/disables recursive searching with respect to classes.
`void` | `setSearchClassname(java.lang.String searchClass)` Deprecated. 11.1.1.1 use `setPrimarySearchClass`
`void` | `setSearchLanguage(java.lang.String language)` Sets the search language.
`void` | `setSearchSelection(java.lang.String searchSelection)` Sets the search selection.
`void` | `setSortSpecification(SortSpecification sort)` Sets the Sort Specification.
`void` | `setStartingRowNumber(int rowNumber)` Sets the starting row number.
`void` | `setStatementKey(java.lang.String key)` Sets the statement key.
`protected LibrarySession` | `verifyConnected()` Return the current LibrarySession if the session is connected; otherwise raise a "not connected" exception.

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

Field Detail

### DEFAULT_ALIAS

    public static final java.lang.String DEFAULT_ALIAS

  Description copied from class: `PreparedSelector`
  The default search alias.

  See Also:
    Constant Field Values

Constructor Detail

### PreparedSelector

    public PreparedSelector(LibrarySession session)
                     throws IfsException

  Constructs a PreparedSelector.

  Parameters:
    `session` - the current session.
  Throws:
    `IfsException` - if the operation fails.

Method Detail

### getSession

    public LibrarySession getSession()
                              throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the session being used by this Selector.

  Returns:
    the current session
  Throws:
    `IfsException` - if the operation fails.

### getStatementKey

    public java.lang.String getStatementKey()
                                     throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the statement key.

  Returns:
    the statement key
  Throws:
    `IfsException` - if the operation fails.

### getSortSpecification

    public SortSpecification getSortSpecification()
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the Sort Specification.

  Returns:
    the search item sort specificaion.
  Throws:
    `IfsException` - if the operation fails.

### getPrimarySearchTarget

    public AttributeValue getPrimarySearchTarget()
                                          throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the primary search target.

  The AttributeValue returned encapulates the class name (as the AttributeValue's name) and the alias (as the AttributeValue's value).

  Returns:
    the primary search target.
  Throws:
    `IfsException` - if operation fails.

### getAuxiliarySearchTargets

    public AttributeValue[] getAuxiliarySearchTargets()
                                               throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the auxiliary search targets.

  The AttributeValues returned encapulate the class name (as the AttributeValue's name) and the alias (as the AttributeValue's value).

  Returns:
    the auxiliary search targets.
  Throws:
    `IfsException` - if operation fails.

### getPrimarySearchClass

    public java.lang.String getPrimarySearchClass()
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the search class that was previously set.

  Returns:
    the search class.
  Throws:
    `IfsException` - if operation fails.

### getPrimarySearchAlias

    public java.lang.String getPrimarySearchAlias()
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the alias used for the primary search class.

  Returns:
    the primary search alias.
  Throws:
    `IfsException` - if operation fails.

### getClassFromTarget

    protected java.lang.String getClassFromTarget(AttributeValue target)
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the class name from the specified search target.

  Parameters:
    `target` - the search target specification.
  Returns:
    the class name.
  Throws:
    `IfsException` - if operation fails.

### getAliasFromTarget

    protected java.lang.String getAliasFromTarget(AttributeValue target)
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the alias name from the specified search target.

  Parameters:
    `target` - the search target specification.
  Returns:
    the alias name.
  Throws:
    `IfsException` - if operation fails.

### getSearchSelection

    public java.lang.String getSearchSelection()
                                        throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the search selection that was set using setSearchSelection()

  Returns:
    the search selection.
  Throws:
    `IfsException` - if operation fails.

### isDistinct

    public boolean isDistinct()
                       throws IfsException

  Description copied from class: `PreparedSelector`
  Returns true if distinct searching is enabled with respect to classes.

  Returns:
    true if distinct enabled.
  Throws:
    `IfsException` - if the operation fails.

### isRecursiveSearch

    public boolean isRecursiveSearch()
                              throws IfsException

  Description copied from class: `PreparedSelector`
  Returns true if recursive searching is enabled with respect to classes.

  Returns:
    true if recursive enabled.
  Throws:
    `IfsException` - if the operation fails.

### getSearchLanguage

    public java.lang.String getSearchLanguage()
                                       throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the search language in effect.

  A value of null indicates that the default language should be used.

  Returns:
    the search language in effect
  Throws:
    `IfsException` - if operation fails.

### getMaxItemCount

    public int getMaxItemCount()
                        throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the maximum number of items that will be returned by `getItems`.

  A value of zero indicates that there is no limit on the desired number of items.

  Returns:
    maximum number of items that will be returned
  Throws:
    `IfsException` - if the operation fails.

### getStartingRowNumber

    public int getStartingRowNumber()
                             throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the starting row number.

  The value is 1-based, meaning that if the value is set to 101, the first 100 rows will be skipped. A value of zero or less is treated the same same as a setting of 1, indicating that no rows are skipped.

  Returns:
    the starting row number
  Throws:
    `IfsException` - if the operation fails.

### getHint

    public java.lang.String getHint()
                             throws IfsException

  Description copied from class: `PreparedSelector`
  Gets the SQL hint to use for the main select.

  Returns:
    the SQL hint
  Throws:
    `IfsException` - if the operation fails.

### getBindValues

    public AttributeValue[] getBindValues()
                                   throws IfsException

  Description copied from class: `PreparedSelector`
  Gets the bind values to use in the select statement.

  Returns:
    the bind values
  Throws:
    `IfsException` - if the operation fails.

### getSqlStatement

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

  Description copied from class: `PreparedSelector`
  Gets the SQL statement that will be used.

  The SQL is returned as an array of strings, that when concatenated with space delimiters is the SQL emited for this selector. The elements of the array contain the following elements:

  - the selected columns
  - the from clause
  - the where clause
  - the order by clause

  Returns:
    the SQL statement
  Throws:
    `IfsException` - if the operation fails.

### setStatementKey

    public void setStatementKey(java.lang.String key)
                         throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the statement key.

  Parameters:
    `key` - the statement key.
  Throws:
    `IfsException` - if operation fails.

### setDistinct

    public void setDistinct(boolean distinct)
                     throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the indication as to whether a "select distinct" will be used.

  Parameters:
    `distinct` - true if distinct is used; false otherwise.
  Throws:
    `IfsException` - if operation fails.

### setPrimarySearchTarget

    public void setPrimarySearchTarget(AttributeValue target)
                                throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the primary search target.

  Parameters:
    `target` - the primary search target.
  Throws:
    `IfsException` - if operation fails.

### setPrimarySearchClass

    public void setPrimarySearchClass(java.lang.String className)
                               throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the primary search target, specifying the class name only.

  Parameters:
    `className` - the search class.
  Throws:
    `IfsException` - if operation fails.

### setSearchClassname

    public void setSearchClassname(java.lang.String searchClass)
                            throws IfsException

  Deprecated. 11.1.1.1 use `setPrimarySearchClass`

  Description copied from class: `PreparedSelector`
  Sets the primary search class.

  Parameters:
    `searchClass` - the primary search class.
  Throws:
    `IfsException` - if operation fails.

### setAuxiliarySearchTargets

    public void setAuxiliarySearchTargets(AttributeValue[] targets)
                                   throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the auxiliary search targets.

  Parameters:
    `targets` - the auxiliary search targets.
  Throws:
    `IfsException` - if operation fails.

### setSortSpecification

    public void setSortSpecification(SortSpecification sort)
                              throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the Sort Specification.

  Parameters:
    `sort` - the sort specificaion.
  Throws:
    `IfsException` - if the operation fails.

### applySortSpecificationDefaults

    protected void applySortSpecificationDefaults()
                                           throws IfsException

  Description copied from class: `PreparedSelector`
  Applies the primary search target settings as the default class/alias for the current sort specification.

  Throws:
    `IfsException` - if the operation fails.
  (Unpublished)

### setSearchSelection

    public void setSearchSelection(java.lang.String searchSelection)
                            throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the search selection.

  Parameters:
    `searchSelection` - the search selection.
  Throws:
    `IfsException` - if operation fails.

### setRecursiveSearch

    public void setRecursiveSearch(boolean recursive)
                            throws IfsException

  Description copied from class: `PreparedSelector`
  Enables/disables recursive searching with respect to classes. The default is set true. This is equivalent to adding _R to the class name in extended SQL syntax.

  Parameters:
    `recursive` - true for enabled.
  Throws:
    `IfsException` - if the operation fails.

### setSearchLanguage

    public void setSearchLanguage(java.lang.String language)
                           throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the search language.

  A value of null indicates that the default language should be used.

  Parameters:
    `language` - the search language
  Throws:
    `IfsException` - if operation fails.

### setMaxItemCount

    public void setMaxItemCount(int maxItemCount)
                         throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the maximum number of items that will be returned by `getItems`.

  A value of zero indicates that there is no limit on the desired number of items.

  Parameters:
    `maxItemCount` - maximum number of items that will be returned
  Throws:
    `IfsException` - if the operation fails.

### setStartingRowNumber

    public void setStartingRowNumber(int rowNumber)
                              throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the starting row number.

  The value is 1-based, meaning that if the value is set to 101, the first 100 rows will be skipped. A value of zero or less is treated the same same as a setting of 1, indicating that no rows are skipped.

  Parameters:
    `rowNumber` - the starting row number
  Throws:
    `IfsException` - if the operation fails.

### setHint

    public void setHint(java.lang.String hint)
                 throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the SQL hint to use for the main select.

  Parameters:
    `hint` - the SQL hint
  Throws:
    `IfsException` - if the operation fails.

### setBindValues

    public void setBindValues(AttributeValue[] bindValues)
                       throws IfsException

  Description copied from class: `PreparedSelector`
  Sets the bind values to use in the select statement.

  Parameters:
    `bindValues` - the bind values
  Throws:
    `IfsException` - if the operation fails.

### getItems

    public LibraryObject[] getItems()
                             throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the entire search results as an array.

  Returns:
    the search results.
  Throws:
    `IfsException` - if operation fails.

### getItemCount

    public int getItemCount()
                     throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the search result count.

  Returns:
    the search result count.
  Throws:
    `IfsException` - if operation fails.

### verifyConnected

    protected LibrarySession verifyConnected()
                                      throws IfsException

  Description copied from class: `PreparedSelector`
  Return the current LibrarySession if the session is connected; otherwise raise a "not connected" exception.

  Returns:
    the current session
  Throws:
    `IfsException` - 21000: if not connected

### getAliasFromTarget

    public static java.lang.String getAliasFromTarget(LibrarySessionInterface session,
                                                      AttributeValue target)
                                               throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the alias name from the specified search target.

  Parameters:
    `session` - the session context
    `target` - the search target specification.
  Returns:
    the alias name.
  Throws:
    `IfsException` - if operation fails.

### getViewFromTarget

    public static java.lang.String getViewFromTarget(LibrarySessionInterface session,
                                                     AttributeValue target)
                                              throws IfsException

  Description copied from class: `PreparedSelector`
  Returns the overridden view name from the specified search target.

  Parameters:
    `session` - the session context
    `target` - the search target specification.
  Returns:
    the view name, or null if no override is specified.
  Throws:
    `IfsException` - if operation fails.

### getExistsSecurityClause

    public static java.lang.String getExistsSecurityClause(java.lang.String alias,
                                                           java.lang.String attrName)

  Description copied from class: `PreparedSelector`
  Return a condition that can be used to restrict results based on the user's ability to discover the object referred to by an attribute.

  Returns a SQL-style "exists" clause that will exclude all rows except for the ones where the value of the specified PublicObject attribute can be discovered by the current user.

  The caller must ensure that the specified attribute is of type PublicObject.

  This condition contains one bind value indicator (?) that corresponds to the requesting user ID. The current User's ID should be specified as a bind value on the PreparedSelector if this condition is included in the search selection criteria.

  Parameters:
    `alias` - the table alias; defaults to "x" if null
    `attrName` - the attribute for which discoverability will be checked
  Returns:
    the condition which can be included in the Search Selection (where clause) for the PreparedSelector

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