From 780b92ada9afcf1d58085a83a0b9e6bc982203d1 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 17 Feb 2015 17:25:57 +0000 Subject: Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz. --- docs/java/com/sleepycat/db/SecondaryDatabase.html | 1057 ++++++++++----------- 1 file changed, 517 insertions(+), 540 deletions(-) (limited to 'docs/java/com/sleepycat/db/SecondaryDatabase.html') diff --git a/docs/java/com/sleepycat/db/SecondaryDatabase.html b/docs/java/com/sleepycat/db/SecondaryDatabase.html index 3c335cc8..cd06c9b2 100644 --- a/docs/java/com/sleepycat/db/SecondaryDatabase.html +++ b/docs/java/com/sleepycat/db/SecondaryDatabase.html @@ -1,130 +1,132 @@ - - - - - -SecondaryDatabase (Oracle - Berkeley DB Java API) - - - - - - - - - - - - -
- - +//--> + + - - - - - - - - - - - - - - - - -
-Berkeley DB
version 5.3.21
-
- + + +
+ + +
+ + + - -
-

- -com.sleepycat.db -
-Class SecondaryDatabase

-
-java.lang.Object
-  extended by com.sleepycat.db.Database
-      extended by com.sleepycat.db.SecondaryDatabase
-
-
-
-
public class SecondaryDatabase
extends Database
- - -

-A secondary database handle. +

+
com.sleepycat.db
+

Class SecondaryDatabase

+
+
+ +
+
    +
  • +
    +
    +
    public class SecondaryDatabase
    +extends Database
    +
    A secondary database handle.

    -Secondary databases are opened with Environment.openSecondaryDatabase and are +Secondary databases are opened with Environment.openSecondaryDatabase and are always associated with a single primary database. The distinguishing characteristics of a secondary database are:

    • Records are automatically added to a secondary database when records are added, modified and deleted in the primary database. Direct calls to put() methods on a secondary database are prohibited.
    • -
    • The delete method of a secondary database will delete +
    • The delete method of a secondary database will delete the primary record and as well as all its associated secondary records.
    • Calls to all get() methods will return the data from the associated primary database.
    • Additional get() method signatures are provided to return the primary key in an additional pKey parameter.
    • -
    • Calls to openCursor will return a SecondaryCursor, which itself has get() methods that return +
    • Calls to openCursor will return a SecondaryCursor, which itself has get() methods that return the data of the primary database and additional get() method signatures for returning the primary key.
    • -
    • The openSecondaryCursor method is provided -to return a SecondaryCursor that doesn't require casting.
    • +
    • The openSecondaryCursor method is provided +to return a SecondaryCursor that doesn't require casting.

    -Before opening or creating a secondary database you must implement the SecondaryKeyCreator +Before opening or creating a secondary database you must implement the SecondaryKeyCreator interface.

    For example, to create a secondary database that supports duplicates: @@ -148,163 +150,152 @@ Note that the associations between primary and secondary databases are not stored persistently. Whenever a primary database is opened for write access by the application, the appropriate associated secondary databases should also be opened by the application. This is necessary to ensure data integrity when -changes are made to the primary database. -

    - -

    -


    - -

    - +changes are made to the primary database.

    +
  • +
+
+
+ +
+
+
    +
  • - - - - - - -
    -Constructor Detail
    - -

    -SecondaryDatabase

    -
    -public SecondaryDatabase(String fileName,
    -                         String databaseName,
    -                         Database primaryDatabase,
    -                         SecondaryConfig config)
    -                  throws DatabaseException,
    -                         FileNotFoundException
    -
    -
    Open a database. +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SecondaryDatabase

        +
        public SecondaryDatabase(java.lang.String fileName,
        +                 java.lang.String databaseName,
        +                 Database primaryDatabase,
        +                 SecondaryConfig config)
        +                  throws DatabaseException,
        +                         java.io.FileNotFoundException
        +
        Open a database.

        The database is represented by the file and database parameters.

        @@ -317,7 +308,7 @@ record number. The Recno format supports fixed- or variable-length records, accessed sequentially or by logical record number, and optionally backed by a flat text file.

        -Storage and retrieval are based on key/data pairs; see DatabaseEntry +Storage and retrieval are based on key/data pairs; see DatabaseEntry for more information.

        Opening a database is a relatively expensive operation, and maintaining @@ -330,50 +321,46 @@ null. Note that in-memory databases can only ever be shared by sharing the single database handle that created them, in circumstances where doing so is safe. The environment variable TMPDIR may be used as a directory in which to create temporary backing files. -

        -

        -

        -
        Parameters:
        fileName - The name of an underlying file that will be used to back the database. +

        +
        Parameters:
        fileName - The name of an underlying file that will be used to back the database. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters. -

        databaseName - An optional parameter that allows applications to have multiple +

        databaseName - An optional parameter that allows applications to have multiple databases in a single file. Although no databaseName parameter needs to be specified, it is an error to attempt to open a second database in a physical file that was not initially created using a databaseName parameter. Further, the databaseName parameter is not supported by the Queue format. -

        primaryDatabase - a database handle for the primary database that is to be indexed. -

        config - The secondary database open attributes. If null, default attributes are used. -
        Throws: -
        DatabaseException -
        FileNotFoundException
        -
    - +

    primaryDatabase - a database handle for the primary database that is to be indexed. +

    config - The secondary database open attributes. If null, default attributes are used.
    +
    Throws:
    +
    DatabaseException
    +
    java.io.FileNotFoundException
    +
  • +
+ + - - - - - - -
-Method Detail
- -

-openCursor

-
-public Cursor openCursor(Transaction txn,
-                         CursorConfig config)
-                  throws DatabaseException
-
-
Return a cursor into the database. -

-

-

-
Overrides:
openCursor in class Database
-
-
-
Parameters:
txn - To use a cursor for writing to a transactional database, an explicit +
    +
  • + + +

    Method Detail

    + + + +
      +
    • +

      openCursor

      +
      public Cursor openCursor(Transaction txn,
      +                CursorConfig config)
      +                  throws DatabaseException
      +
      Return a cursor into the database. +

      +
      +
      Overrides:
      +
      openCursor in class Database
      +
      Parameters:
      txn - To use a cursor for writing to a transactional database, an explicit transaction must be specified. For read-only access to a transactional database, the transaction may be null. For a non-transactional database, the transaction must be null. @@ -381,30 +368,28 @@ public DatabaseException - if a failure occurs.
      -
-
-
- -

-openSecondaryCursor

-
-public SecondaryCursor openSecondaryCursor(Transaction txn,
-                                           CursorConfig config)
-                                    throws DatabaseException
-
-
Obtain a cursor on a database, returning a SecondaryCursor. - Calling this method is the equivalent of calling openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig) and - casting the result to SecondaryCursor. -

-

-

-
Parameters:
txn - To use a cursor for writing to a transactional database, an explicit +

config - The cursor attributes. If null, default attributes are used. +

+
Returns:
A database cursor. +

+
Throws:
+
DatabaseException - if a failure occurs.
+ + + + + +
-
-
- -

-getPrimaryDatabase

-
-public Database getPrimaryDatabase()
-
-
Returns the primary database associated with this secondary database. -

-

-

- -
Returns:
the primary database associated with this secondary database.
-
-
-
- -

-getConfig

-
-public DatabaseConfig getConfig()
-                         throws DatabaseException
-
-
Return this Database object's configuration. +

config - The cursor attributes. If null, default attributes are used. +

+
Returns:
A secondary database cursor. +

+
Throws:
+
DatabaseException - if a failure occurs.
+ + + + + +
    +
  • +

    getPrimaryDatabase

    +
    public Database getPrimaryDatabase()
    +
    Returns the primary database associated with this secondary database. +

    +
    Returns:
    the primary database associated with this secondary database.
    +
  • +
+ + + +
    +
  • +

    getConfig

    +
    public DatabaseConfig getConfig()
    +                         throws DatabaseException
    +
    Return this Database object's configuration.

    This may differ from the configuration used to open this object if the database existed previously. +

    +
    +
    Overrides:
    +
    getConfig in class Database
    +
    Returns:
    This Database object's configuration.

    -

    -

    -
    Overrides:
    getConfig in class Database
    -
    -
    - -
    Returns:
    This Database object's configuration. -

    -

    -

    Throws: -
    DatabaseException - if a failure occurs.
    -
    -
    -
    - -

    -getSecondaryConfig

    -
    -public SecondaryConfig getSecondaryConfig()
    -                                   throws DatabaseException
    -
    -
    Returns a copy of the secondary configuration of this database. -

    -

    -

    - -
    Returns:
    a copy of the secondary configuration of this database. -

    +

    +
    Throws:
    +
    DatabaseException - if a failure occurs.
    +
  • +
+ + + +
    +
  • +

    getSecondaryConfig

    +
    public SecondaryConfig getSecondaryConfig()
    +                                   throws DatabaseException
    +
    Returns a copy of the secondary configuration of this database. +

    +
    Returns:
    a copy of the secondary configuration of this database.

    -

    Throws: -
    DatabaseException - if a failure occurs.
    -
-
-
- -

-get

-
-public OperationStatus get(Transaction txn,
-                           DatabaseEntry key,
-                           DatabaseEntry pKey,
-                           DatabaseEntry data,
-                           LockMode lockMode)
-                    throws DatabaseException
-
-
Retrieves the key/data pair with the given key. If the matching key has +

+
Throws:
+
DatabaseException - if a failure occurs.
+ + + + + +
    +
  • +

    get

    +
    public OperationStatus get(Transaction txn,
    +                  DatabaseEntry key,
    +                  DatabaseEntry pKey,
    +                  DatabaseEntry data,
    +                  LockMode lockMode)
    +                    throws DatabaseException
    +
    Retrieves the key/data pair with the given key. If the matching key has duplicate values, the first data item in the set of duplicates is returned. -Retrieval of duplicates requires the use of Cursor operations. -

    -

    -

    -
    Parameters:
    txn - For a transactional database, an explicit transaction may be specified to +Retrieval of duplicates requires the use of Cursor operations. +

    +
    Parameters:
    txn - For a transactional database, an explicit transaction may be specified to transaction-protect the operation, or null may be specified to perform the operation without transaction protection. For a non-transactional database, null must be specified. -

    key - the secondary key +

    key - the secondary key used as input. It must be initialized with a non-null byte array by the caller. -

    pKey - the primary key +

    pKey - the primary key returned as output. Its byte array does not need to be initialized by the caller. -

    data - the primary data +

    data - the primary data returned as output. Its byte array does not need to be initialized by the caller. -

    lockMode - the locking attributes; if null, default attributes are used. -

    -

    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is -found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS. -

    +

    lockMode - the locking attributes; if null, default attributes are used. +

    +
    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is +found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS.

    -

    Throws: -
    DeadlockException - if the operation was selected to resolve a +

    +
    Throws:
    +
    DeadlockException - if the operation was selected to resolve a deadlock. -

    -

    IllegalArgumentException - if an invalid parameter was specified. -

    -

    DatabaseException - if a failure occurs.
    - - -
    - -

    -getSearchBoth

    -
    -public OperationStatus getSearchBoth(Transaction txn,
    -                                     DatabaseEntry key,
    -                                     DatabaseEntry pKey,
    -                                     DatabaseEntry data,
    -                                     LockMode lockMode)
    -                              throws DatabaseException
    -
    -
    Retrieves the key/data pair with the specified secondary and primary key, that +

    +
    java.lang.IllegalArgumentException - if an invalid parameter was specified. +

    +
    DatabaseException - if a failure occurs.
    +
  • +
+ + + +
    +
  • +

    getSearchBoth

    +
    public OperationStatus getSearchBoth(Transaction txn,
    +                            DatabaseEntry key,
    +                            DatabaseEntry pKey,
    +                            DatabaseEntry data,
    +                            LockMode lockMode)
    +                              throws DatabaseException
    +
    Retrieves the key/data pair with the specified secondary and primary key, that is, both the primary and secondary key items must match. -

    -

    -

    -
    Parameters:
    txn - For a transactional database, an explicit transaction may be specified to +

    +
    Parameters:
    txn - For a transactional database, an explicit transaction may be specified to transaction-protect the operation, or null may be specified to perform the operation without transaction protection. For a non-transactional database, -null must be specified.
    key - the secondary key +null must be specified.
    key - the secondary key used as input. It must be initialized with a non-null byte array by the -caller.
    pKey - the primary key +caller.
    pKey - the primary key used as input. It must be initialized with a non-null byte array by the -caller.
    data - the primary data +caller.
    data - the primary data returned as output. Its byte array does not need to be initialized by the caller. -

    lockMode - the locking attributes; if null, default attributes are used. +

    lockMode - the locking attributes; if null, default attributes are used. +

    +
    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is +found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS.

    -

    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is -found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS. -

    -

    -

    Throws: -
    DeadlockException - if the operation was selected to resolve a +

    +
    Throws:
    +
    DeadlockException - if the operation was selected to resolve a deadlock. -

    -

    IllegalArgumentException - if an invalid parameter was specified. -

    -

    DatabaseException - if a failure occurs.
    - - -
    - -

    -getSearchRecordNumber

    -
    -public OperationStatus getSearchRecordNumber(Transaction txn,
    -                                             DatabaseEntry key,
    -                                             DatabaseEntry pKey,
    -                                             DatabaseEntry data,
    -                                             LockMode lockMode)
    -                                      throws DatabaseException
    -
    -
    Retrieves the key/data pair associated with the specific numbered record of the database. +

    +
    java.lang.IllegalArgumentException - if an invalid parameter was specified. +

    +
    DatabaseException - if a failure occurs.
    +
  • +
+ + + +
    +
  • +

    getSearchRecordNumber

    +
    public OperationStatus getSearchRecordNumber(Transaction txn,
    +                                    DatabaseEntry key,
    +                                    DatabaseEntry pKey,
    +                                    DatabaseEntry data,
    +                                    LockMode lockMode)
    +                                      throws DatabaseException
    +
    Retrieves the key/data pair associated with the specific numbered record of the database.

    The data field of the specified key must be a byte array containing a -record number, as described in DatabaseEntry. This determines +record number, as described in DatabaseEntry. This determines the record to be retrieved.

    For this method to be called, the underlying database must be of type Btree, and it must have been configured to support record numbers.

    If this method fails for any reason, the position of the cursor will be -unchanged. -

    -

    -
    Parameters:
    key - the secondary key +unchanged.
    +
    Parameters:
    key - the secondary key returned as output. Its byte array does not need to be initialized by the -caller.
    pKey - the primary key +caller.
    pKey - the primary key returned as output. Its byte array does not need to be initialized by the -caller.
    data - the primary data +caller.
    data - the primary data returned as output. Multiple results can be retrieved by passing an object -that is a subclass of MultipleEntry, otherwise its byte array does not -need to be initialized by the caller.
    lockMode - the locking attributes; if null, default attributes are used. -
    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is -found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS. -
    Throws: -
    NullPointerException - if a DatabaseEntry parameter is null or +that is a subclass of MultipleEntry, otherwise its byte array does not +need to be initialized by the caller.
    lockMode - the locking attributes; if null, default attributes are used.
    +
    Returns:
    OperationStatus.NOTFOUND if no matching key/data pair is +found; OperationStatus.KEYEMPTY if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, OperationStatus.SUCCESS.
    +
    Throws:
    +
    java.lang.NullPointerException - if a DatabaseEntry parameter is null or does not contain a required non-null byte array. -

    -

    DeadlockException - if the operation was selected to resolve a +

    +
    DeadlockException - if the operation was selected to resolve a deadlock. -

    -

    IllegalArgumentException - if an invalid parameter was specified. -

    -

    DatabaseException - if a failure occurs. -

    - - +

    +

    java.lang.IllegalArgumentException - if an invalid parameter was specified. +

    +
    DatabaseException - if a failure occurs. +

    +
  • +
+ + + + +
+
-
- - - - - - - - - - - - - - - - - - -
-Berkeley DB
version 5.3.21
-
- + + +
+ + +
+ + + - -
-Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved. - - +

Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.

+ + -- cgit v1.2.1