public class AncestorManager extends java.lang.Object
In this class I refer to the pivot as the record which may have children and/or a parent. This class creates ancestor records for the pivot - parent and pivot - child relationships. Ancestor records for the pivot-child relationship may be handled on the save of the child (where the child is the pivot and the pivot is the parent).
One condition this class does not yet handle is the case where the parent of the pivot and the parent of the parent are not inserted yet. So far this is prevented by the client classes of this class.
Another unhandled condition is when an existing child is assigned a new parent and
reassigned to the original parent in the same MboSet.
If the pivot is a WO, the key attribute is WONUM and the ancestor table is WOAncestor.
If the pivot is a PM, the key attribute is PMNUM and the ancestor table is PMAncestor.
If the pivot is a ASSET, the key attribute is ASSETNUM and the ancestor table is AssetAncestor.
The ancestor attribute in the ancestor table is ANCESTOR.
The hierarchy levels attribute in the ancestor table is HIERARCHYLEVELS.
The ancestor table has a primary key consisting of site/org attribute(s), the key attribute, the ancestor attribute, and the hierarchylevels attribute.
The pivot MboSet has attributes PARENT and HASCHILDREN.
The pivot MboSet (ASSET) has attributes PARENT and CHILDREN.
That there is a PARENT relationship that fetches the Mbo identified by the PARENT attribute.
That there is a CHILDREN relationship that fetches a Mbo's sub-records. If the parent is modifiable it is passed with the pivot to the AncestorManager and the pivot is a member of the parent's CHILDREN MboSet.
That members of a CHILDREN set can be made top-level or be deleted, but may not be reassigned to a new parent from the CHILDREN MboSet.
|Modifier and Type||Method and Description|
Searches for an existing AncestorManager to use or creates one if none found.
public static void updateAncestorRecords(AncMbo pivot, AncMbo parent) throws MXException, java.rmi.RemoteException
public static void updateAncestorRecords(AncMbo pivot) throws MXException, java.rmi.RemoteException
pivot- The Mbo in memory the AM is being invoked for.