public interface SecondaryAssociation
Modifier and Type | Method and Description |
---|---|
Database |
getPrimary(DatabaseEntry primaryKey)
Returns the primary database for the given primary key.
|
Collection<SecondaryDatabase> |
getSecondaries(DatabaseEntry primaryKey)
Returns the secondary databases associated with the given primary key.
|
boolean |
isEmpty()
Returns true if there are no secondary databases in the association.
|
boolean isEmpty()
SecondaryAssociation
to be configured on a primary database even when it has no associated
secondaries, with no added overhead, and to allow for the possibility
that secondaries will be added later.
For example, when a primary database has no secondaries, no internal
latching is performed by JE during writes. JE determines that no
secondaries are present by calling isEmpty
, prior to doing the
write operation.
RuntimeException
- if an unexpected problem occurs. It will be
wrapped in an EnvironmentFailureException
and thrown to the
application, causing the operation and transaction to be aborted.Database getPrimary(DatabaseEntry primaryKey)
SecondaryAssociation
.
This method should return null when the primary database has been
removed from the association, or when it should not be included in the
results for secondary queries. In this case, the current operation will
treat the secondary record as if it does not exist, i.e., it will be
skipped over.RuntimeException
- if an unexpected problem occurs. It will be
wrapped in an EnvironmentFailureException
and thrown to the
application, causing the operation and transaction to be aborted.Collection<SecondaryDatabase> getSecondaries(DatabaseEntry primaryKey)
SecondaryAssociation
.RuntimeException
- if an unexpected problem occurs. It will be
wrapped in an EnvironmentFailureException
and thrown to the
application, causing the operation and transaction to be aborted.Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved.