class KeysIndex<SK,PK> extends BasicIndex<SK,PK>
concurrentDB, db, emptyRange, entityAdapter, keyAdapter, keyBinding, keyClass, locking, NO_RETURN_ENTRY, sortedDups, transactional
Constructor and Description |
---|
KeysIndex(Database db,
java.lang.Class<SK> keyClass,
EntryBinding keyBinding,
java.lang.Class<PK> pkeyClass,
EntryBinding pkeyBinding) |
Modifier and Type | Method and Description |
---|---|
PK |
get(SK key)
Gets an entity via a key of this index.
|
PK |
get(Transaction txn,
SK key,
LockMode lockMode)
Gets an entity via a key of this index.
|
(package private) boolean |
isUpdateAllowed() |
java.util.Map<SK,PK> |
map()
Returns a standard Java map based on this entity index.
|
java.util.SortedMap<SK,PK> |
sortedMap()
Returns a standard Java sorted map based on this entity index.
|
KeysIndex(Database db, java.lang.Class<SK> keyClass, EntryBinding keyBinding, java.lang.Class<PK> pkeyClass, EntryBinding pkeyBinding) throws DatabaseException
DatabaseException
public PK get(SK key) throws DatabaseException
EntityIndex
The operation will not be transaction protected, and LockMode.DEFAULT
is used implicitly.
key
- the key to search for.OperationFailureException
- if one of the Read Operation
Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
DatabaseException
- the base class for all BDB exceptions.public PK get(Transaction txn, SK key, LockMode lockMode) throws DatabaseException
EntityIndex
txn
- the transaction used to protect this operation, or null
if the operation should not be transaction protected.key
- the key to search for.lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.OperationFailureException
- if one of the Read Operation
Failures occurs.EnvironmentFailureException
- if an unexpected, internal or
environment-wide failure occurs.
DatabaseException
- the base class for all BDB exceptions.public java.util.Map<SK,PK> map()
EntityIndex
StoredMap
returned is defined by the Collections API. Stored collections conform
to the standard Java collections framework interface.public java.util.SortedMap<SK,PK> sortedMap()
EntityIndex
StoredSortedMap
returned is defined by the Collections API. Stored collections conform
to the standard Java collections framework interface.boolean isUpdateAllowed()
isUpdateAllowed
in class BasicIndex<SK,PK>
Copyright (c) 2004-2012 Oracle. All rights reserved.