de.esprit.netsuite.server.abo

## Class AbstractDBRecordABO<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>
            - - de.esprit.netsuite.server.abo.AbstractDBRecordABO<C,S,I>

- All Implemented Interfaces:
    DBPersistent, DBRecord, 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

      public abstract class AbstractDBRecordABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
      extends AbstractPersistentABO<C,S,I>
      implements DBRecord

  This is a wrapper for an ABO instance which implements the `DBRecord` interface and thus can be handled by `DBRecordTable`, `DBRecordList` and other `DBRecord` capable classes. All methods just delgate to the internally kept `DBRecord` instance. This class is very useful if you want to extend your database objects with non persistent fields.
  Author:
    Rainer Buesch
  See Also:
    `DBRecord`, Serialized Form

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object arg)`
    `void` | `dbDelete()` Deletes the representing record from the database.
    `void` | `dbInsert()` Inserts the object as a record into the database.
    `void` | `dbLoad(DBLoadMonitor monitor, SqlCondition condition)` Reads a set of objects from from the database according to the given condition.
    `void` | `dbLoad(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order)` Reads a set of objects from from the database according to the given condition and order.
    `void` | `dbRehash()` Re-reads the object state from the database.
    `void` | `dbSearch(DBLoadMonitor monitor, SqlCondition condition)` Reads a set of objects from from the database according to the given condition.
    `void` | `dbSearch(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order)` Reads a set of objects from from the database according to the given condition and order.
    `DBRecord[]` | `dbSearch(SqlCondition condition)` Reads a set of objects from from the database according to the given condition.
    `DBRecord[]` | `dbSearch(SqlCondition condition, SqlOrder order)` Reads a set of objects from from the database according to the given condition and order.
    `DBRecord[]` | `dbSelect(SqlCondition condition)` Reads a set of objects from from the database according to the given condition.
    `DBRecord[]` | `dbSelect(SqlCondition condition, SqlOrder order)` Reads a set of objects from from the database according to the given condition and order.
    `void` | `dbUpdate()` Writes the object's current state to the database.
    `boolean` | `exists()` Checks whether a matching object can be found in the database by performing a primary key lookup in the according table(s).
    `boolean` | `existsField(java.lang.String fieldName)` Tells wasCancelled this field exists in this DBObject.
    `int` | `getFieldCount()` Returns the number columns of this DBObject including primary key columns
    `java.lang.String[]` | `getFieldFullNames()` Returns the full names of all columns in the format table.column
    `java.lang.String` | `getFieldIcon(java.lang.String fieldName)` Returns the name for an icon that should be used to render this column.
    `int` | `getFieldLength(java.lang.String fieldName)` Returns the length (in number or characters) of the given fieldname.
    `java.lang.String[]` | `getFieldNames()` Returns the names of all columns without the table prefix
    `java.lang.String` | `getForeignKeyRef(java.lang.String fieldName)` If the given field is a foreign key field then the referenced fieldname is returned in the format table.column.
    `java.lang.Class` | `getJavaType(java.lang.String fieldName)` Returns the java variable type of the given fieldname.
    `int` | `getJdbcType(java.lang.String fieldName)` Returns the jdbc-type of the given fieldname.
    `DBObject[]` | `getManagedDBObjects()` If the instance is a DBObject then the DBObject itself is returned.
    `DBRecord` | `getMasterRecord()`
    `int` | `getPrimaryKeyCount()` Returns the number of fields that compose the primary key
    `java.lang.String[]` | `getPrimaryKeyValues()` Returns the values of the primary key as a String array.
    `java.lang.String` | `getRecordName()` Returns a unique name for this record, which is usually the tablename.
    `java.lang.Object` | `getValue(java.lang.String fieldName)` Returns the current value of the given fieldname.
    `boolean` | `hasPrimaryKey()` Tells whether this object has a primary key at all
    `boolean` | `isDirty()` Tells whether this object is in sync with the database.
    `boolean` | `isFieldVirtual(java.lang.String fieldName)` Tells wasCancelled this field is supposed to be editable.
    `boolean` | `isForeignKey(java.lang.String fieldName)` Tells wasCancelled this field is a foreign key field.
    `boolean` | `isNotNullField(java.lang.String fieldName)` Tells wasCancelled this field is a not null field.
    `boolean` | `isPrimaryKey(java.lang.String fieldName)` Tells wasCancelled this field is or is part of the primary key.
    `void` | `setPrimaryKeyValues(java.lang.String... pkValues)` Sets the values of the primary key.

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

      `createNewRecord, createOnServer, createPrimaryKey, createRecord, deleteOnServer, equals, find, getRecord, getRenderIcon, overtakeABOValues, setRecord, toDumpString, updateOnServer`

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

      `addChangeListener, clone, 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.appsuite.database.dbase.DBRecord

      `copyRecordValues, getTranslationAppKey`

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

      `deepClone`

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

      `toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from interface de.esprit.common.gui.Renderable

      `getRenderColor, getRenderIcon, getRenderText`

    - ### 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.netsuite.netdata.LastAccessed

      `getLastAccessedTs, getLastAccessorId, setLastAccessorId`

- - ### Constructor Detail

    - #### AbstractDBRecordABO

          public AbstractDBRecordABO(C clientCtx)

    - #### AbstractDBRecordABO

          public AbstractDBRecordABO(S serverCtx)

    - #### AbstractDBRecordABO

          public AbstractDBRecordABO(S serverCtx,
                             DBRecord record)

  - ### Method Detail

    - #### getFieldCount

          public int getFieldCount()

      Description copied from interface: `DBRecord`
      Returns the number columns of this DBObject including primary key columns
      Specified by:
        `getFieldCount` in interface `DBRecord`

    - #### getFieldFullNames

          public java.lang.String[] getFieldFullNames()

      Description copied from interface: `DBRecord`
      Returns the full names of all columns in the format table.column
      Specified by:
        `getFieldFullNames` in interface `DBRecord`

    - #### getFieldNames

          public java.lang.String[] getFieldNames()

      Description copied from interface: `DBRecord`
      Returns the names of all columns without the table prefix
      Specified by:
        `getFieldNames` in interface `DBRecord`

    - #### isPrimaryKey

          public boolean isPrimaryKey(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Tells wasCancelled this field is or is part of the primary key.
      Specified by:
        `isPrimaryKey` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### isForeignKey

          public boolean isForeignKey(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Tells wasCancelled this field is a foreign key field.
      Specified by:
        `isForeignKey` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!
      See Also:
        `DBRecord.getForeignKeyRef(String)`

    - #### isNotNullField

          public boolean isNotNullField(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Tells wasCancelled this field is a not null field.
      Specified by:
        `isNotNullField` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### existsField

          public boolean existsField(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Tells wasCancelled this field exists in this DBObject.
      Specified by:
        `existsField` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### isFieldVirtual

          public boolean isFieldVirtual(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Tells wasCancelled this field is supposed to be editable. Composed objects might have fields that have no representation in the database (because they are calculated fields) and thus cannot be edited.
      Specified by:
        `isFieldVirtual` in interface `DBRecord`
      Parameters:
        `fieldName` - can be the pure column name or in the format table.column - only the column name is checked!

    - #### getForeignKeyRef

          public java.lang.String getForeignKeyRef(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      If the given field is a foreign key field then the referenced fieldname is returned in the format table.column.
      Specified by:
        `getForeignKeyRef` in interface `DBRecord`
      Parameters:
        `fieldName` - The name of the field in the format table.column - only the column name is checked!

    - #### getValue

          public java.lang.Object getValue(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Returns the current value of the given fieldname.
      Specified by:
        `getValue` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### getJdbcType

          public int getJdbcType(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Returns the jdbc-type of the given fieldname.
      Specified by:
        `getJdbcType` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!
      See Also:
        `Types`

    - #### getFieldLength

          public int getFieldLength(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Returns the length (in number or characters) of the given fieldname.
      Specified by:
        `getFieldLength` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### getJavaType

          public java.lang.Class getJavaType(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Returns the java variable type of the given fieldname.
      Specified by:
        `getJavaType` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### getFieldIcon

          public java.lang.String getFieldIcon(java.lang.String fieldName)

      Description copied from interface: `DBRecord`
      Returns the name for an icon that should be used to render this column. The icon-name must be a pathname relative to the 'images/' base-directory and must not have any extension ('.gif' is supposed automatically).
      Specified by:
        `getFieldIcon` in interface `DBRecord`
      Parameters:
        `fieldName` - might be a pure column name or in the format table.column - only the column name is checked!

    - #### getManagedDBObjects

          public DBObject[] getManagedDBObjects()

      Description copied from interface: `DBRecord`
      If the instance is a DBObject then the DBObject itself is returned. But if the object is composed of other DBObjects then a list of of all those building pieces must be returned (all who have the same primary key).

      ### Example

      For instance a 'Poti' object may consist of three DBObjects called 'DBO_part', 'DBO_resistor' and 'DBO_poti' - in the order of their inheritance hierarchy. All these objects have got the same primary key 'part_id'. Thus a 'Poti' object must return an array of the master instances of all comprising DBObjects which are 'DBO_part', 'DBO_resistor' and 'DBO_poti'.
      Specified by:
        `getManagedDBObjects` in interface `DBRecord`

    - #### getMasterRecord

          public DBRecord getMasterRecord()

      Specified by:
        `getMasterRecord` in interface `DBRecord`

    - #### hasPrimaryKey

          public boolean hasPrimaryKey()

      Description copied from interface: `DBPersistent`
      Tells whether this object has a primary key at all
      Specified by:
        `hasPrimaryKey` in interface `DBPersistent`

    - #### getPrimaryKeyCount

          public int getPrimaryKeyCount()

      Description copied from interface: `DBPersistent`
      Returns the number of fields that compose the primary key
      Specified by:
        `getPrimaryKeyCount` in interface `DBPersistent`

    - #### getPrimaryKeyValues

          public java.lang.String[] getPrimaryKeyValues()

      Description copied from interface: `DBPersistent`
      Returns the values of the primary key as a String array. Note that the primary key must consist of data types that are representable by a String!
      Specified by:
        `getPrimaryKeyValues` in interface `DBPersistent`

    - #### setPrimaryKeyValues

          public void setPrimaryKeyValues(java.lang.String... pkValues)

      Description copied from interface: `DBPersistent`
      Sets the values of the primary key. Note that the order of the array elements must match the primary key definition in the table.
      Specified by:
        `setPrimaryKeyValues` in interface `DBPersistent`

    - #### dbUpdate

          public void dbUpdate()
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Writes the object's current state to the database. After this action the state of the object will be valid.
      Specified by:
        `dbUpdate` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`
      See Also:
        `DBPersistent.isDirty()`

    - #### dbInsert

          public void dbInsert()
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Inserts the object as a record into the database.
      Specified by:
        `dbInsert` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbDelete

          public void dbDelete()
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Deletes the representing record from the database. After this action the state of the object will be invalid.
      Specified by:
        `dbDelete` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`
      See Also:
        `DBPersistent.isDirty()`

    - #### dbRehash

          public void dbRehash()
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Re-reads the object state from the database. After this action the state of the object will be valid.
      Specified by:
        `dbRehash` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`
      See Also:
        `DBPersistent.isDirty()`

    - #### dbSelect

          public DBRecord[] dbSelect(SqlCondition condition)
                              throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition. The default ordering is by primary key.
      Specified by:
        `dbSelect` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbSelect

          public DBRecord[] dbSelect(SqlCondition condition,
                            SqlOrder order)
                              throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition and order.
      Specified by:
        `dbSelect` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbLoad

          public void dbLoad(DBLoadMonitor monitor,
                    SqlCondition condition)
                      throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition. The default ordering is by primary key.
      Specified by:
        `dbLoad` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbLoad

          public void dbLoad(DBLoadMonitor monitor,
                    SqlCondition condition,
                    SqlOrder order)
                      throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition and order.
      Specified by:
        `dbLoad` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbSearch

          public DBRecord[] dbSearch(SqlCondition condition)
                              throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition. The default ordering is by primary key.
      Specified by:
        `dbSearch` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbSearch

          public DBRecord[] dbSearch(SqlCondition condition,
                            SqlOrder order)
                              throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition and order.
      Specified by:
        `dbSearch` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbSearch

          public void dbSearch(DBLoadMonitor monitor,
                      SqlCondition condition)
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition. The default ordering is by primary key.
      Specified by:
        `dbSearch` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### dbSearch

          public void dbSearch(DBLoadMonitor monitor,
                      SqlCondition condition,
                      SqlOrder order)
                        throws java.lang.Exception

      Description copied from interface: `DBPersistent`
      Reads a set of objects from from the database according to the given condition and order.
      Specified by:
        `dbSearch` in interface `DBPersistent`
      Throws:
        `java.lang.Exception`

    - #### exists

          public boolean exists()

      Description copied from interface: `DBPersistent`
      Checks whether a matching object can be found in the database by performing a primary key lookup in the according table(s). Does not change the object itself in any way.
      Specified by:
        `exists` in interface `DBPersistent`

    - #### isDirty

          public boolean isDirty()

      Description copied from interface: `DBPersistent`
      Tells whether this object is in sync with the database. If it has been modified since the last rehash it will be in a dirty state.
      Specified by:
        `isDirty` in interface `DBPersistent`

    - #### getRecordName

          public java.lang.String getRecordName()

      Description copied from interface: `DBPersistent`
      Returns a unique name for this record, which is usually the tablename. On more complex composed persistent objects this may be any other identifying name.
      Specified by:
        `getRecordName` in interface `DBPersistent`

    - #### compareTo

          public int compareTo(java.lang.Object arg)

      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Overrides:
        `compareTo` in class `AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.