final class InverseSyncher extends AssociationSyncher
AssociationSyncher,
ForeignResolver,
RelationInfo,
RecordBufferAssociationSyncher.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<java.lang.String> |
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<Record> newLocalDMOs,
Record newForeignDMO)
The foreign end of an association has changed.
|
protected Record |
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<Record> |
retrieveLocalDMOs()
Retrieve the set of DMOs which comprise the local end of the foreign
association.
|
acquireLock, attemptSynchprivate 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<java.lang.String> getLegacyKeys()
getLegacyKeys in class AssociationSyncherprotected void preSynch(java.util.Set<Record> newLocalDMOs, Record newForeignDMO) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
preSynch in class AssociationSynchernewLocalDMOs - 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<Record> retrieveLocalDMOs() throws PersistenceException
AssociationSyncher.acquireLock(java.lang.Long, 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 AssociationSynchernull.PersistenceException - if there are any errors retrieving DMOs from the database.protected Record retrieveForeignDMO() throws PersistenceException
retrieveForeignDMO in class AssociationSyncherPersistenceException - if there are any errors retrieving the DMO from the database.