final class DataView
extends java.lang.Object
implements java.lang.Cloneable
This class defines a view and takes care of reading and updating indices, calling bindings, constraining access to a key range, etc.
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
btreeRecNumAccess |
(package private) boolean |
btreeRecNumDb |
(package private) CurrentTransaction |
currentTxn |
(package private) CursorConfig |
cursorConfig |
(package private) Database |
db |
(package private) boolean |
dupsAllowed |
(package private) DatabaseEntry |
dupsKey |
(package private) boolean |
dupsOrdered |
(package private) KeyRange |
dupsRange |
(package private) boolean |
dupsView |
(package private) EntityBinding |
entityBinding |
(package private) PrimaryKeyAssigner |
keyAssigner |
(package private) EntryBinding |
keyBinding |
(package private) boolean |
keyRangesAllowed |
(package private) boolean |
keysRenumbered |
(package private) boolean |
ordered |
(package private) KeyRange |
range |
(package private) boolean |
readUncommittedAllowed |
(package private) boolean |
recNumAccess |
(package private) boolean |
recNumAllowed |
(package private) boolean |
recNumRenumber |
(package private) SecondaryDatabase |
secDb |
(package private) SecondaryKeyCreator |
secKeyCreator |
(package private) boolean |
transactional |
(package private) EntryBinding |
valueBinding |
(package private) boolean |
writeAllowed |
Constructor and Description |
---|
DataView(Database database,
EntryBinding keyBinding,
EntryBinding valueBinding,
EntityBinding entityBinding,
boolean writeAllowed,
PrimaryKeyAssigner keyAssigner)
Creates a view for a given database and bindings.
|
Modifier and Type | Method and Description |
---|---|
(package private) OperationStatus |
append(java.lang.Object value,
java.lang.Object[] retPrimaryKey,
java.lang.Object[] retValue)
Appends a value and returns the new key.
|
(package private) boolean |
canDeriveKeyFromValue()
Returns whether data keys can be derived from the value/entity binding
of this view, which determines whether a value/entity object alone is
sufficient for operations that require keys.
|
(package private) void |
clear()
Deletes all records in the current range.
|
(package private) DataView |
configuredView(CursorConfig config)
Returns a new view with a specified cursor configuration.
|
(package private) DataView |
duplicatesView(java.lang.Object secondaryKey,
EntryBinding primaryKeyBinding)
Return a new duplicates view for a given secondary key.
|
(package private) CurrentTransaction |
getCurrentTxn()
Returns the current transaction for the view or null if the environment
is non-transactional.
|
(package private) Environment |
getEnv()
Returns the environment for the database.
|
(package private) DatabaseEntry |
getSingleKeyThang()
Returns the key thang for a single key range, or null if a single key
range is not used.
|
(package private) boolean |
isEmpty()
Returns whether no records are present in the view.
|
(package private) boolean |
isSecondary()
Returns whether this is a view on a secondary database rather
than directly on a primary database.
|
(package private) DataCursor |
join(DataCursor[] indexCursors,
JoinConfig joinConfig)
Returns a cursor for this view that reads only records having the
index key values at the specified cursors.
|
(package private) DataCursor |
join(DataView[] indexViews,
java.lang.Object[] indexKeys,
JoinConfig joinConfig)
Returns a cursor for this view that reads only records having the
specified index key values.
|
(package private) DataView |
keySetView()
Return a new key-set view derived from this view by setting the
entity and value binding to null.
|
(package private) java.lang.Object |
makeKey(DatabaseEntry keyThang,
DatabaseEntry priKeyThang)
Converts a key entry to a key object.
|
(package private) java.lang.Object |
makeValue(DatabaseEntry primaryKeyThang,
DatabaseEntry valueThang)
Converts a key-value entry pair to a value object.
|
(package private) KeyRange |
subRange(KeyRange useRange,
java.lang.Object singleKey)
Intersects the given key and the current range.
|
(package private) KeyRange |
subRange(KeyRange useRange,
java.lang.Object beginKey,
boolean beginInclusive,
java.lang.Object endKey,
boolean endInclusive)
Intersects the given range and the current range.
|
(package private) DataView |
subView(java.lang.Object beginKey,
boolean beginInclusive,
java.lang.Object endKey,
boolean endInclusive,
EntryBinding keyBinding)
Return a new value-set view for key range, optionally changing
the key binding.
|
(package private) boolean |
useKey(java.lang.Object key,
java.lang.Object value,
DatabaseEntry keyThang,
KeyRange checkRange)
Populates the key entry and returns whether the key is within range.
|
(package private) KeyRange |
useSubRange()
Returns the range to use for sub-ranges.
|
(package private) Transaction |
useTransaction()
Returns the current transaction if the database is transaction, or null
if the database is not transactional or there is no current transaction.
|
(package private) void |
useValue(java.lang.Object value,
DatabaseEntry valueThang,
DatabaseEntry checkKeyThang)
Populates the value entry and throws an exception if the primary key
would be changed via an entity binding.
|
(package private) DataView |
valueSetView()
Return a new value-set view derived from this view by setting the
key binding to null.
|
(package private) DataView |
valueSetView(java.lang.Object singleKey)
Return a new value-set view for single key range.
|
Database db
SecondaryDatabase secDb
CurrentTransaction currentTxn
KeyRange range
EntryBinding keyBinding
EntryBinding valueBinding
EntityBinding entityBinding
PrimaryKeyAssigner keyAssigner
SecondaryKeyCreator secKeyCreator
CursorConfig cursorConfig
boolean writeAllowed
boolean ordered
boolean keyRangesAllowed
boolean recNumAllowed
boolean recNumAccess
boolean btreeRecNumDb
boolean btreeRecNumAccess
boolean recNumRenumber
boolean keysRenumbered
boolean dupsAllowed
boolean dupsOrdered
boolean transactional
boolean readUncommittedAllowed
DatabaseEntry dupsKey
boolean dupsView
KeyRange dupsRange
DataView(Database database, EntryBinding keyBinding, EntryBinding valueBinding, EntityBinding entityBinding, boolean writeAllowed, PrimaryKeyAssigner keyAssigner) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
DataView keySetView()
DataView valueSetView()
DataView valueSetView(java.lang.Object singleKey) throws DatabaseException, KeyRangeException
singleKey
- the single key value.DatabaseException
- if a database problem occurs.KeyRangeException
- if the specified range is not within the
current range.DataView subView(java.lang.Object beginKey, boolean beginInclusive, java.lang.Object endKey, boolean endInclusive, EntryBinding keyBinding) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
DataView duplicatesView(java.lang.Object secondaryKey, EntryBinding primaryKeyBinding) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
DataView configuredView(CursorConfig config)
CurrentTransaction getCurrentTxn()
DatabaseEntry getSingleKeyThang()
final Environment getEnv()
final boolean isSecondary()
boolean isEmpty() throws DatabaseException
DatabaseException
OperationStatus append(java.lang.Object value, java.lang.Object[] retPrimaryKey, java.lang.Object[] retValue) throws DatabaseException
DatabaseException
Transaction useTransaction()
void clear() throws DatabaseException
DatabaseException
DataCursor join(DataView[] indexViews, java.lang.Object[] indexKeys, JoinConfig joinConfig) throws DatabaseException
DatabaseException
DataCursor join(DataCursor[] indexCursors, JoinConfig joinConfig) throws DatabaseException
DatabaseException
boolean useKey(java.lang.Object key, java.lang.Object value, DatabaseEntry keyThang, KeyRange checkRange) throws DatabaseException
DatabaseException
final boolean canDeriveKeyFromValue()
void useValue(java.lang.Object value, DatabaseEntry valueThang, DatabaseEntry checkKeyThang)
java.lang.Object makeKey(DatabaseEntry keyThang, DatabaseEntry priKeyThang)
java.lang.Object makeValue(DatabaseEntry primaryKeyThang, DatabaseEntry valueThang)
KeyRange subRange(KeyRange useRange, java.lang.Object singleKey) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
KeyRange subRange(KeyRange useRange, java.lang.Object beginKey, boolean beginInclusive, java.lang.Object endKey, boolean endInclusive) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
KeyRange useSubRange() throws DatabaseException
DatabaseException
Copyright (c) 2004-2012 Oracle. All rights reserved.