de.esprit.netsuite.server.abo

## Class AbstractPersistentABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.netsuite.netdata.AbstractCrossPlatformObject<C,S>
      - - de.esprit.netsuite.server.core.AccessibleServerObject<C,S>
        - - de.esprit.netsuite.server.abo.AbstractABO<C,S,I>
          - - de.esprit.netsuite.server.abo.AbstractPersistentABO<C,S,I>

- All Implemented Interfaces:
    Renderable, SimpleLogSupport, DeepCloneable, Dumpable, ClientObject<C>, CrossPlatformObject<C,S>, LastAccessed, AliveBusinessObject<C,S,I>, RemoteLockable, PermissionControlled, ServerObject<S>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
  Direct Known Subclasses:
    AbstractDBRecordABO, TankABO

      public abstract class AbstractPersistentABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
      extends AbstractABO<C,S,I>

  This is the base class for business objects based on a database persistent record.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractPersistentABO(C clientCtx)`
    `AbstractPersistentABO(C clientCtx, DBRecord record)`
    `AbstractPersistentABO(S serverCtx)`
    `AbstractPersistentABO(S serverCtx, DBRecord record)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract DBRecord` | `createNewRecord()`
    `protected I` | `createOnServer()`
    `protected PrimaryKey` | `createPrimaryKey()` The ABO class must create the PrimaryKey it will need by its own.
    `protected abstract DBRecord` | `createRecord(java.lang.Object... pkValues)`
    `protected boolean` | `deleteOnServer()` Is called on server side before the ABO is deleted and removed from the cache
    `boolean` | `equals(java.lang.Object obj)`
    `I[]` | `find(boolean withLock, SqlCondition cond)`
    `DBRecord` | `getRecord()`
    `javax.swing.Icon` | `getRenderIcon()`
    `protected void` | `overtakeABOValues(I inst)` Must be implemented by subclasses to copy their instance values
    `void` | `setRecord(DBRecord record)`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `protected void` | `updateOnServer()` Needs only be overridden to ensure persistence before ABO is replaced in the cache.

    - ### Methods inherited from class de.esprit.netsuite.server.abo.AbstractABO

      `addChangeListener, clone, compareTo, copyABOValues, create, createChangeGate, createPermissionDefinition, deepClone, delete, drop, dropOnServer, fetch, findCachedABOs, fireABOInitialized, getPermissionDefinition, getPrimaryKey, getRenderColor, getRenderText, getResourceName, getResourceType, getUpdateCount, hashCode, isbeingAccessed, isCacheResident, isLockedByMe, isNumb, isOnline, isVisibleInClientMonitor, receivedUpdateEvent, refetch, removeChangeListener, setLocked, setNumb, toString, update, update`

    - ### Methods inherited from class de.esprit.netsuite.server.core.AccessibleServerObject

      `getLastAccessedTs, getLastAccessorId, setLastAccessorId`

    - ### Methods inherited from class de.esprit.netsuite.netdata.AbstractCrossPlatformObject

      `checkOnClient, checkOnServer, getClientContext, getLogChannel, getServerContext, isLogDebug, isLogVerbose, isOnClient, isOnServer, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setClientContext, setLogChannel, setServerContext`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.netsuite.server.abo.AliveBusinessObject

      `createEditDialog, instantiateOnServer`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.CrossPlatformObject

      `isOnClient, isOnServer, setClientContext, setServerContext`

    - ### Methods inherited from interface de.esprit.netsuite.client.ClientObject

      `getClientContext`

    - ### Methods inherited from interface de.esprit.netsuite.server.ServerObject

      `getServerContext`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toString`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.LastAccessed

      `getLastAccessedTs, getLastAccessorId, setLastAccessorId`

- - ### Constructor Detail

    - #### AbstractPersistentABO

          public AbstractPersistentABO(C clientCtx)

    - #### AbstractPersistentABO

          public AbstractPersistentABO(S serverCtx)

    - #### AbstractPersistentABO

          public AbstractPersistentABO(C clientCtx,
                               DBRecord record)

    - #### AbstractPersistentABO

          public AbstractPersistentABO(S serverCtx,
                               DBRecord record)

  - ### Method Detail

    - #### getRecord

          public DBRecord getRecord()

    - #### setRecord

          public void setRecord(DBRecord record)

    - #### getRenderIcon

          public javax.swing.Icon getRenderIcon()

      Specified by:
        `getRenderIcon` in interface `Renderable`
      Overrides:
        `getRenderIcon` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

    - #### createPrimaryKey

          protected final PrimaryKey createPrimaryKey()

      Description copied from class: `AbstractABO`
      The ABO class must create the PrimaryKey it will need by its own. The PrimaryKey is never changed on an ABO instance, but you may change the primary key values.
      Specified by:
        `createPrimaryKey` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

    - #### createNewRecord

          protected abstract DBRecord createNewRecord()

    - #### createRecord

          protected abstract DBRecord createRecord(java.lang.Object... pkValues)
                                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### find

          public I[] find(boolean withLock,
                 SqlCondition cond)
                                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### createOnServer

          protected I createOnServer()
                                                          throws java.lang.Exception

      Overrides:
        `createOnServer` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`
      Throws:
        `java.lang.Exception`

    - #### updateOnServer

          protected void updateOnServer()
                                 throws java.lang.Exception

      Description copied from class: `AbstractABO`
      Needs only be overridden to ensure persistence before ABO is replaced in the cache.
      Overrides:
        `updateOnServer` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`
      Throws:
        `java.lang.Exception`

    - #### deleteOnServer

          protected boolean deleteOnServer()
                                    throws java.lang.Exception

      Description copied from class: `AbstractABO`
      Is called on server side before the ABO is deleted and removed from the cache
      Overrides:
        `deleteOnServer` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`
      Returns:
        true if the ABO was found for deletion
      Throws:
        `java.lang.Exception`

    - #### overtakeABOValues

          protected void overtakeABOValues(I inst)

      Description copied from class: `AbstractABO`
      Must be implemented by subclasses to copy their instance values
      Specified by:
        `overtakeABOValues` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.