psdi.app.system

Class AutoKey

  • All Implemented Interfaces:
    java.rmi.Remote, AutoKeyRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class AutoKey
    extends Mbo
    implements AutoKeyRemote
    Mbo object for maintenance of the AutoKey table.

    This class should not be confused with the class psdi.mbo.AutoKey, which is used at runtime to generate values from the autokey table to be assigned to key fields on other mbos. For generating an autokeyed value at runtime, see MboValue autoKey.

    A row should exist in this table for each attribute where CanAutoNum is True and AutokeyName is not null (see MaxAttribute), and each Organization (AutokeyName, OrgID).

    This is a system level object.

    The key attributes for this object are AutoKeyName, OrgID, and SiteID.

    The attributes in this object are as follows:

    Attribute NameDescription
    AutoKeyNameThe name of this autokey. AutoKeyName is referenced in MaxAttribute.
    OrgIDThe organization ID. Foreign key to Organization. Will be non-null for Organization and Site autokeys.
    PrefixAn optional prefix to be concatenated with (seed + 1) to yield the autokey value.
    SeedThe sequential autokey value. The next value to be assigned will equal (seed + 1).
    SetIDThe set ID. Foreign key to Sets. Will be non-null for Sets autokeys.
    SiteIDThe site ID. Foreign key to Site. If this is an organization-level autokey, this will be null. If this is a site-level table and the user wants site-specific autokeying for this attribute, then siteID will be non-null.
    See Also:
    AutoKey, MboValue.autoKey()
    • Constructor Detail

      • AutoKey

        public AutoKey(MboSet ms)
                throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a mbo, defaulting the attributes shown below. Owner must be Organization, Site, or Sets.
        Attribute NameAttribute Value
        DescriptionIf owner is Set, value of message system-autokeyDescItemSet or system-autokeyDescCompanySet.
        OrgIDIf owner is Organization or Site, owner's OrgID.
        SetIDIf owner is Set, owner's SetID.
        SiteIDIf owner is Site, owner's SiteID.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        If this is a site-level seed (siteid is not null), it can be deleted. If this is an org-level seed, then the owner must be Organization and the the owner must be "toBeDeleted."
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        If this is a site-level seed for the PO table, then prefix cannot be null.

        If deleting a site-level seed (siteid is not null), update the seed value of its org-level autokey to be the greater of the site seed or the org seed.

        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException