Interface RelationshipManager
- All Known Implementing Classes:
RelationshipManagerImpl
public interface RelationshipManager
Manager for (bidirectional) relationships of an object (StateManager).
Designed as a stand-alone process to run just before flush.
Updates on bidirectional relations are registered during the persistence process.
Call to checkConsistency() will check for consistency and throw exceptions as appropriate.
Call to process() will perform updates at the other side of the registered relations so all is consistent.
TODO Cater for Map put/remove calls
TODO Consider sharing info with org.datanucleus.flush.OperationQueue which holds similar information (but only when optimistic)
-
Method Summary
Modifier and TypeMethodDescriptionvoidMethod to check for consistency the managed relations of this object with the related objects.voidConvenience method to clear all fields from being managed.booleanmanagesField(int fieldNumber) Accessor for whether a field is being managed.voidprocess()Method to process the (bidirectional) relations for this object.voidrelationAdd(int fieldNumber, Object val) Method to register a change in the contents of a container field, with an object being added.voidrelationChange(int fieldNumber, Object oldValue, Object newValue) Method that is called when the user calls setXXX() on a field.voidrelationRemove(int fieldNumber, Object val) Method to register a change in the contents of a container field, with an object being removed.
-
Method Details
-
clearFields
void clearFields()Convenience method to clear all fields from being managed. -
relationChange
-
relationAdd
Method to register a change in the contents of a container field, with an object being added.- Parameters:
fieldNumber- Number of the fieldval- Value being added
-
relationRemove
Method to register a change in the contents of a container field, with an object being removed.- Parameters:
fieldNumber- Number of the fieldval- Value being removed
-
managesField
boolean managesField(int fieldNumber) Accessor for whether a field is being managed.- Parameters:
fieldNumber- Number of the field- Returns:
- Whether it is currently managed
-
checkConsistency
void checkConsistency()Method to check for consistency the managed relations of this object with the related objects. -
process
void process()Method to process the (bidirectional) relations for this object.
-