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.server
Class LibraryQueryStatement

    java.lang.Object
      oracle.ifs.server.LibraryQueryStatement

    public final class LibraryQueryStatement

extends java.lang.Object

A LibraryQueryStatement is used to generate JDBC PreparedStatements for select statements.

(Unpublished)

Field Summary
`static int` | `INHERENT_PARAMS_PER_PUBLIC_CLASS` The maximum inherent parameters used per PublicObject class.

Constructor Summary
`LibraryQueryStatement(java.lang.String key, LibraryConnection lconn, SearchTarget[] targets, java.lang.String whereClause, SortSpecification sort, boolean countOnly, boolean distinct, int maxCopies)` Constructs a LibraryQueryStatement.
`LibraryQueryStatement(java.lang.String key, LibraryConnection lconn, SearchTarget[] targets, java.lang.String whereClause, SortSpecification sort, java.lang.String hint, boolean countOnly, boolean distinct, int maxCopies)` Constructs a LibraryQueryStatement.

Method Summary
`void` | `close()` Close and clear the Prepared statement.
`static java.lang.String` | `concatWhereClause(java.lang.String str1, java.lang.String str2)` Concatenates two where clauses.
`int` | `getAccessCount()` Get the number of times the statement has been accessed
`long` | `getAccessSequence()` Gets the last access sequence; used by LibraryConnection for purging.
`java.lang.String` | `getKey()` Gets the key by which this LibraryQueryStatement is stored in the LibraryConnection.
`LibraryConnection` | `getLibraryConnection()` Gets the LibraryConnection for this LibraryQueryStatement.
`int` | `getMaxCopiesPerConnection()` Gets the maximum number of copies of this LibraryQueryStatement that will be cached by each LibraryConnection.
`int` | `getParamOffset(S_LibrarySession sess)` Return the index of the first param that represents user-defined parameters.
`long` | `getRsn()` Get the resolution sequence number of this instance, which reflects the RSN of the LibraryConnection at the time this instance was constructed.
`java.sql.PreparedStatement` | `getStatement(S_LibrarySession sess)` Return the Prepared statement.
`int` | `incrementAccessCount()` Increment the number of times the statement has been accessed.
`static boolean` | `obtainRowLockByIdWithNowait(S_LibrarySession session, java.lang.String tablename, java.lang.String columnname, java.lang.Long id)` Issues a SQL statement that will lock a row in table.
`void` | `setAccessSequence(long seq)` Sets the last access sequence; used by LibraryConnection for purging.
`void` | `setInherentParameters(S_LibrarySession sess)` Sets the parameters that are not user-defined.

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

Field Detail

### INHERENT_PARAMS_PER_PUBLIC_CLASS

    public static final int INHERENT_PARAMS_PER_PUBLIC_CLASS

  Description copied from class: `LibraryQueryStatement`
  The maximum inherent parameters used per PublicObject class.

  Currently has the value of 2.

  See Also:
    Constant Field Values

Constructor Detail

### LibraryQueryStatement

    public LibraryQueryStatement(java.lang.String key,
                                 LibraryConnection lconn,
                                 SearchTarget[] targets,
                                 java.lang.String whereClause,
                                 SortSpecification sort,
                                 boolean countOnly,
                                 boolean distinct,
                                 int maxCopies)
                          throws IfsException

  Constructs a LibraryQueryStatement.

  Parameters:
    `lconn` - the connection context
    `targets` - the search targets; must be at least one
    `whereClause` - the search condition
    `sort` - the sort condition
    `countOnly` - whether to select the count only
    `distinct` - whether to include a distinct clause
    `maxCopies` - max copies of the statement per connection
  Throws:
    `IfsException` - if the operation fails

### LibraryQueryStatement

    public LibraryQueryStatement(java.lang.String key,
                                 LibraryConnection lconn,
                                 SearchTarget[] targets,
                                 java.lang.String whereClause,
                                 SortSpecification sort,
                                 java.lang.String hint,
                                 boolean countOnly,
                                 boolean distinct,
                                 int maxCopies)
                          throws IfsException

  Constructs a LibraryQueryStatement.

  Parameters:
    `lconn` - the connection context
    `targets` - the search targets; must be at least one
    `whereClause` - the search condition
    `sort` - the sort condition
    `hint` - the SQL hint for the main select
    `countOnly` - whether to select the count only
    `distinct` - whether to include a distinct clause
    `maxCopies` - max copies of the statement per connection
  Throws:
    `IfsException` - if the operation fails

Method Detail

### setAccessSequence

    public final void setAccessSequence(long seq)

  Description copied from class: `LibraryQueryStatement`
  Sets the last access sequence; used by LibraryConnection for purging.

  Parameters:
    `seq` - the Access Sequence

### getAccessSequence

    public final long getAccessSequence()

  Description copied from class: `LibraryQueryStatement`
  Gets the last access sequence; used by LibraryConnection for purging.

  Returns:
    the Access Sequence

### getKey

    public final java.lang.String getKey()

  Description copied from class: `LibraryQueryStatement`
  Gets the key by which this LibraryQueryStatement is stored in the LibraryConnection.

  Returns:
    the key

### getLibraryConnection

    public final LibraryConnection getLibraryConnection()

  Description copied from class: `LibraryQueryStatement`
  Gets the LibraryConnection for this LibraryQueryStatement.

  Returns:
    the LibraryConnection

### getRsn

    public long getRsn()

  Description copied from class: `LibraryQueryStatement`
  Get the resolution sequence number of this instance, which reflects the RSN of the LibraryConnection at the time this instance was constructed.

  Returns:
    the resolution sequence number

### getMaxCopiesPerConnection

    public final int getMaxCopiesPerConnection()

  Description copied from class: `LibraryQueryStatement`
  Gets the maximum number of copies of this LibraryQueryStatement that will be cached by each LibraryConnection.

  Returns:
    the maximum number of copies to keep

### getAccessCount

    public int getAccessCount()

  Description copied from class: `LibraryQueryStatement`
  Get the number of times the statement has been accessed

  Returns:
    the number of times the statement has been accessed

### incrementAccessCount

    public int incrementAccessCount()

  Description copied from class: `LibraryQueryStatement`
  Increment the number of times the statement has been accessed.

  Returns:
    the updated count of the number of times the statement has been accessed

### getStatement

    public java.sql.PreparedStatement getStatement(S_LibrarySession sess)
                                            throws IfsException

  Description copied from class: `LibraryQueryStatement`
  Return the Prepared statement.

  Parameters:
    `sess` - the session context
  Returns:
    the Prepared statement
  Throws:
    `IfsException` - if the operation fails

### close

    public void close()

  Description copied from class: `LibraryQueryStatement`
  Close and clear the Prepared statement.

### getParamOffset

    public int getParamOffset(S_LibrarySession sess)
                       throws IfsException

  Description copied from class: `LibraryQueryStatement`
  Return the index of the first param that represents user-defined parameters.

  This is directly related to the number of PublicObject classes in the classes list.

  Parameters:
    `sess` - the session context
  Returns:
    the parameter offset
  Throws:
    `IfsException` - if the operation fails

### setInherentParameters

    public void setInherentParameters(S_LibrarySession sess)
                               throws IfsException

  Description copied from class: `LibraryQueryStatement`
  Sets the parameters that are not user-defined.

  Sets any parameters in the query that pertain to PublicObject security clauses.

  Parameters:
    `sess` - the session context
  Throws:
    `IfsException` - if the operation fails

### concatWhereClause

    public static java.lang.String concatWhereClause(java.lang.String str1,
                                                     java.lang.String str2)

  Description copied from class: `LibraryQueryStatement`
  Concatenates two where clauses.

  Parameters:
    `str1` - the first clause
    `str2` - the second clause
  Returns:
    the concatenated clause

### obtainRowLockByIdWithNowait

    public static boolean obtainRowLockByIdWithNowait(S_LibrarySession session,
                                                      java.lang.String tablename,
                                                      java.lang.String columnname,
                                                      java.lang.Long id)
                                               throws IfsException

  Description copied from class: `LibraryQueryStatement`
  Issues a SQL statement that will lock a row in table. the caller specifies the table name and the ID column, along with an ID value. A database lock is attempted by issuing a "Select ... For Update nowait". This will throw an IfsException if the select is unsuccessful.

  Parameters:
    `session` - the requesting session
    `tablename` - the database table name
    `columnname` - the ID column in the specified table
    `id` - the ID value
  Returns:
    whether there was a row with the specified id
  Throws:
    `IfsException` - 20011: if unable to obtain the lock

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