java.lang.Object
org.eclipse.persistence.internal.core.sessions.CoreAbstractRecord
org.eclipse.persistence.internal.sessions.AbstractRecord
All Implemented Interfaces:
Serializable, Cloneable, Map, DataRecord
Direct Known Subclasses:
DatabaseRecord, EISMappedRecord, XMLRecord

public abstract class AbstractRecord extends CoreAbstractRecord implements DataRecord, Cloneable, Serializable, Map

Purpose: Define the abstract definition of a record for internal use. Public API should reference the Map or Record interface. Subclasses are DatabaseRecord and XMLRecord.

Responsibilities:

  • Implement the Record and Map interfaces.
See Also:
  • Field Details

    • fields

      protected Vector<DatabaseField> fields
      Use vector to store the fields/values for optimal performance.
    • values

      protected Vector values
      Use vector to store the fields/values for optimal performance.
    • lookupField

      protected DatabaseField lookupField
      Optimize field creation for field name lookup.
    • size

      protected int size
      PERF: Cache the row size.
    • noEntry

      public static final AbstractRecord.NoEntry noEntry
      INTERNAL: indicator showing that no entry exists for a given key.
    • nullValueInFields

      protected boolean nullValueInFields
      INTERNAL: flag for any database field containing a null value
    • sopObject

      protected transient Object sopObject
      INTERNAL: SerializedObjectPolicy support
  • Constructor Details

    • AbstractRecord

      protected AbstractRecord()
      INTERNAL: converts JDBC results to collections of rows.
    • AbstractRecord

      protected AbstractRecord(int initialCapacity)
      INTERNAL: converts JDBC results to collections of rows.
    • AbstractRecord

      protected AbstractRecord(Vector fields, Vector values)
      INTERNAL: converts JDBC results to collections of rows.
    • AbstractRecord

      protected AbstractRecord(Vector fields, Vector values, int size)
      INTERNAL: converts JDBC results to collections of rows.
  • Method Details

    • resetSize

      protected void resetSize()
      Reset the row size. This must be reset after any change to the row.
    • add

      public void add(DatabaseField key, Object value)
      INTERNAL: Add the field-value pair to the row. Will not check, will simply add to the end of the row
    • clear

      public void clear()
      PUBLIC: Clear the contents of the row.
      Specified by:
      clear in interface Map
    • clone

      public AbstractRecord clone()
      INTERNAL: Clone the row and its values.
      Overrides:
      clone in class Object
    • contains

      public boolean contains(Object value)
      PUBLIC: Check if the value is contained in the row.
    • containsKey

      public boolean containsKey(Object key)
      PUBLIC: Check if the field is contained in the row. Conform to hashtable interface.
      Specified by:
      containsKey in interface Map
    • containsKey

      public boolean containsKey(String fieldName)
      PUBLIC: Check if the field is contained in the row.
    • containsKey

      public boolean containsKey(DatabaseField key)
      INTERNAL: Check if the field is contained in the row.
    • containsValue

      public boolean containsValue(Object value)
      PUBLIC: Check if the value is contained in the row.
      Specified by:
      containsValue in interface Map
    • elements

      public Enumeration elements()
      PUBLIC: Returns an Enumeration of the values.
    • entrySet

      public Set entrySet()
      PUBLIC: Returns a set of the keys.
      Specified by:
      entrySet in interface Map
    • get

      public Object get(Object key)
      PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing null is returned.
      Specified by:
      get in interface Map
    • get

      public Object get(String fieldName)
      PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing null is returned.
    • getLookupField

      protected DatabaseField getLookupField(String fieldName)
      Internal: factored out of getIndicatingNoEntry(String) to reduce complexity and have get(string) use get(DatabaseField) instead of getIndicatingNoEntry and then doing an extra check
    • getIndicatingNoEntry

      public Object getIndicatingNoEntry(String fieldName)
      PUBLIC: Retrieve the value for the field name. A field is constructed on the name to check the hash table. If missing DatabaseRow.noEntry is returned.
    • get

      public Object get(DatabaseField key)
      INTERNAL: Retrieve the value for the field. If missing null is returned.
    • getValues

      public Object getValues(DatabaseField key)
    • getValues

      public Object getValues(String key)
    • getIndicatingNoEntry

      public Object getIndicatingNoEntry(DatabaseField key)
      INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.
    • getField

      public DatabaseField getField(DatabaseField key)
      INTERNAL: Returns the row's field with the same name.
    • getFields

      public Vector<DatabaseField> getFields()
      INTERNAL:
    • getValues

      public Vector getValues()
      INTERNAL:
    • isEmpty

      public boolean isEmpty()
      PUBLIC: Return if the row is empty.
      Specified by:
      isEmpty in interface Map
    • hasNullValueInFields

      public boolean hasNullValueInFields()
      INTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.
    • keys

      public Enumeration keys()
      PUBLIC: Returns an Enumeration of the DatabaseField objects.
    • keySet

      public Set keySet()
      PUBLIC: Returns a set of the keys.
      Specified by:
      keySet in interface Map
    • mergeFrom

      public void mergeFrom(AbstractRecord row)
      INTERNAL: Merge the provided row into this row. Existing field values in this row will be replaced with values from the provided row. Fields not in this row will be added from provided row. Values not in provided row will remain in this row.
    • put

      public Object put(Object key, Object value) throws ValidationException
      PUBLIC: Add the field-value pair to the row.
      Specified by:
      put in interface Map
      Throws:
      ValidationException
    • put

      public Object put(String key, Object value)
      PUBLIC: Add the field-value pair to the row.
    • put

      public Object put(DatabaseField key, Object value)
      INTERNAL: Add the field-value pair to the row.
    • putAll

      public void putAll(Map map)
      PUBLIC: Add all of the elements.
      Specified by:
      putAll in interface Map
    • remove

      public Object remove(Object key)
      INTERNAL: Remove the field key from the row.
      Specified by:
      remove in interface Map
    • remove

      public Object remove(String fieldName)
      INTERNAL: Remove the field key from the row.
    • remove

      public Object remove(DatabaseField key)
      INTERNAL: Remove the field key from the row.
    • replaceAt

      public void replaceAt(Object value, int index)
      INTERNAL: replaces the value at index with value
    • replaceAt

      public void replaceAt(Object value, DatabaseField key)
      INTERNAL: replaces the value at field with value
    • setFields

      protected void setFields(Vector fields)
    • setNullValueInFields

      public void setNullValueInFields(boolean nullValueInFields)
      INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwise
    • setValues

      protected void setValues(Vector values)
    • size

      public int size()
      PUBLIC: Return the number of field/value pairs in the row.
      Specified by:
      size in interface Map
    • toString

      public String toString()
      INTERNAL:
      Overrides:
      toString in class Object
    • values

      public Collection values()
      PUBLIC: Returns an collection of the values.
      Specified by:
      values in interface Map
    • hasSopObject

      public boolean hasSopObject()
      INTERNAL:
    • getSopObject

      public Object getSopObject()
      INTERNAL:
    • setSopObject

      public void setSopObject(Object sopObject)
      INTERNAL: