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. The exception
will be thrown to the application, which should then take appropriate
action.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. The exception
will be thrown to the application, which should then take appropriate
action.Collection<SecondaryDatabase> getSecondaries(DatabaseEntry primaryKey)
SecondaryAssociation
.RuntimeException
- if an unexpected problem occurs. The exception
will be thrown to the application, which should then take appropriate
action.Copyright (c) 2002, 2015 Oracle and/or its affiliates. All rights reserved.