final class InverseSyncher extends AssociationSyncher
AssociationSyncher
,
ForeignResolver
,
RelationInfo
,
RecordBuffer
AssociationSyncher.Helper, AssociationSyncher.OneToManyHelper, AssociationSyncher.OneToOneHelper
Modifier and Type | Field and Description |
---|---|
private ForeignResolver |
resolver
Object which resolves a list of DMO IDs from legacy keys
|
buffer, foreignSetter, helper, lockTable
Constructor and Description |
---|
InverseSyncher(RecordBuffer buffer,
RelationInfo info)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Set |
getLegacyKeys()
Retrieve the set of property names which represent the columns which
comprise the legacy key joining two records.
|
protected void |
preSynch(java.util.Set newLocalDMOs,
Persistable newForeignDMO)
The foreign end of an association has changed.
|
protected Persistable |
retrieveForeignDMO()
Retrieve the DMO at the foreign end of the association, which coincides
with the DMO whose property changes triggered synchronization.
|
protected java.util.Set |
retrieveLocalDMOs()
Retrieve the set of DMOs which comprise the local end of the foreign
association.
|
acquireLock, attemptSynch
private final ForeignResolver resolver
InverseSyncher(RecordBuffer buffer, RelationInfo info)
buffer
- Record buffer containing the DMO whose property change(s)
will trigger synchronization attempts.info
- Foreign relation descriptor object.protected java.util.Set getLegacyKeys()
getLegacyKeys
in class AssociationSyncher
protected void preSynch(java.util.Set newLocalDMOs, Persistable newForeignDMO) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
preSynch
in class AssociationSyncher
newLocalDMOs
- Set of zero or more local DMOs which are about to be updated
with the new association.newForeignDMO
- Foreign DMO which is about to be updated with the new
association.java.lang.IllegalAccessException
- if an access error occurs while invoking a method using
reflection.java.lang.reflect.InvocationTargetException
- if a method invoked using reflection throws an exception.protected java.util.Set retrieveLocalDMOs() throws PersistenceException
AssociationSyncher.acquireLock(java.io.Serializable, com.goldencode.p2j.persist.lock.LockType)
to lock the records before they are retrieved.
If the association is one-to-one, the set will contain zero or one records.
If the association is one-to-many, the set may contain zero or more records.
retrieveLocalDMOs
in class AssociationSyncher
null
.PersistenceException
- if there are any errors retrieving DMOs from the database.protected Persistable retrieveForeignDMO() throws PersistenceException
retrieveForeignDMO
in class AssociationSyncher
PersistenceException
- if there are any errors retrieving the DMO from the database.