|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.state.RelationshipManager
public class RelationshipManager
Manager for relationships of a class. Performs management of (bidirectional) relations. If one side is set yet the other isnt, corrects the other side.
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
Localiser for messages. |
| Constructor Summary | |
|---|---|
RelationshipManager(StateManager sm)
Constructor. |
|
| Method Summary | |
|---|---|
void |
checkConsistency()
Method to check for consistency the managed relations of this object with the related objects. |
protected void |
checkManyToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
Method to check consistency of the passed field as M-N. |
protected void |
checkManyToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
Method to check the consistency of the passed field as N-1. |
protected void |
checkOneToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
Method to check the consistency of the passed field as 1-N. |
protected void |
checkOneToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
Method to check the consistency of the passed field as 1-1. |
void |
clearFields()
Convenience method to clear all fields from being managed. |
void |
process()
Method to process the (bidirectional) relations for this object. |
protected void |
processManyToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
Method to process all M-N bidir fields. |
protected void |
processManyToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
Method to process all N-1 bidir fields. |
protected void |
processOneToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
Method to process all 1-N bidir fields. |
protected void |
processOneToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
Method to process all 1-1 bidir fields. |
void |
relationAdd(int fieldNumber,
java.lang.Object val)
Method to register a change in the contents of a container field, with an object being added. |
void |
relationChange(int fieldNumber,
java.lang.Object oldValue,
java.lang.Object newValue)
Method that is called when the user calls setXXX() on a field. |
void |
relationRemove(int fieldNumber,
java.lang.Object val)
Method to register a change in the contents of a container field, with an object being removed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
| Constructor Detail |
|---|
public RelationshipManager(StateManager sm)
sm - StateManager for the object that we are managing relations for.| Method Detail |
|---|
public void clearFields()
public void relationChange(int fieldNumber,
java.lang.Object oldValue,
java.lang.Object newValue)
fieldNumber - Number of the fieldoldValue - The old valuenewValue - The new value
public void relationAdd(int fieldNumber,
java.lang.Object val)
fieldNumber - Number of the fieldval - Value being added
public void relationRemove(int fieldNumber,
java.lang.Object val)
fieldNumber - Number of the fieldval - Value being removedpublic void checkConsistency()
public void process()
protected void checkOneToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
a.b = b1; a.b = b2;so A's b field is changed from b1 to b2. The following changes are likely to be necessary
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManageroldValue - The old valuenewValue - The new value
protected void checkOneToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManagerchanges - List of changes to the collection
protected void checkManyToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManageroldValue - The old valuenewValue - The new value
protected void checkManyToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManagerchanges - List of changes to the collection
protected void processOneToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
a.b = b1; a.b = b2;so A's b field is changed from b1 to b2. The following changes are likely to be necessary
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManageroldValue - The old valuenewValue - The new value
protected void processOneToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManagerchanges - List of changes to the collection
protected void processManyToOneBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.lang.Object oldValue,
java.lang.Object newValue)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManageroldValue - The old valuenewValue - The new value
protected void processManyToManyBidirectionalRelation(AbstractMemberMetaData mmd,
ClassLoaderResolver clr,
ObjectManager om,
java.util.ArrayList changes)
mmd - MetaData for the fieldclr - ClassLoader resolverom - ObjectManagerchanges - List of changes to the collection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||