|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DbSecondaryKeyCreate
An interface specifying a function which constructs secondary keys from primary key and data items.
Method Summary | |
---|---|
int |
secondaryKeyCreate(Db secondary,
Dbt key,
Dbt data,
Dbt result)
The secondaryKeyCreate interface is used by the Db.associate method. |
Method Detail |
---|
int secondaryKeyCreate(Db secondary, Dbt key, Dbt data, Dbt result) throws DbException
secondary
- the database handle for the secondary.key
- a Dbt
referencing the primary key.data
- a Dbt
referencing the primary data item.result
- a zeroed Dbt
in which the callback function should fill in data
and size fields that describe the secondary key.
DB_DONOTINDEX
If any key/data pair in the primary yields a null
secondary key and should be left out of the secondary
index, the callback function may optionally return
Db.DB_DONOTINDEX
. Otherwise, the callback
function should return 0 in case of success or an error
outside of the Berkeley DB name space in case of
failure; the error code will be returned from the
Berkeley DB call that initiated the callback.
If the callback function returns Db.DB_DONOTINDEX
for any key/data pairs in the primary database, the
secondary index will not contain any reference to those
key/data pairs, and such operations as cursor iterations
and range queries will reflect only the corresponding
subset of the database. If this is not desirable, the
application should ensure that the callback function is
well-defined for all possible values and never returns
Db.DB_DONOTINDEX
.
DbException
- Signals that an exception of some sort
has occurred.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |