psdi.mbo

Class FldMboKey

  • All Implemented Interfaces:
    MboConstants, MboValueListener
    Direct Known Subclasses:
    FldAssetChild, FldCommodityCode, FldItemItemStructItemnum, FldLaborLaborcode, FldWFProcessName


    public class FldMboKey
    extends MboValueAdapter
    Used to validate primary keys of a Mbo. This object is attached to the key fields of a Mbo automatically by the business object framework. There can be more than one field that participates in the primary key, but it assumes that none of those fields can be null. To set the names of the key fields, the setKeyAttribtes method is called. When the setValue of any of those specified fields is called it is validated to make sure the value does not exist. This validate does NOT take place if any of the fields in the key are null, or the field is being set as an autokey (which is guarenteed to be unique).
    • Constructor Detail

      • FldMboKey

        public FldMboKey(MboValue mv)
        Construct and attach to the MboValue
    • Method Detail

      • setKeyAttributes

        public void setKeyAttributes(java.lang.String[] keys,
                                     java.lang.String relationship)
        Set the names of the key fields
      • validateKeyCombination

        public void validateKeyCombination(boolean forced)
                                    throws MXException,
                                           java.rmi.RemoteException
        Validation routine which will check for uniqueness In the case of hierarchical Mbos, this method will set the child's HierarchyLink flag. Any sub-classes must clear this flag if they throw an exception.
        Parameters:
        forced - true if it is an enforced validation before save.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        This is a sub-class.
      • findRecord

        public boolean findRecord(java.lang.String tbName,
                                  MboRemote enteredMbo,
                                  java.util.ArrayList keyArray)
                           throws java.rmi.RemoteException,
                                  MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getMboSet

        public MboSetRemote getMboSet()
                               throws MXException,
                                      java.rmi.RemoteException
        Get the mboset used to validate that the value(s) entered are unique.
        Throws:
        MXException
        java.rmi.RemoteException
      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        When an existing record is made a child of another record, the action makes the entered Mbo child the same as the existing Mbo. This means once the action is done, the Mbo's keys will become read/only and the only way to remove the child is to delete the row.
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException