Top Description Inners Fields Constructors Methods
org.eclipse.persistence.internal.sessions

public abstract Class AbstractRecord

extends CoreAbstractRecord
implements DataRecord, Cloneable, Serializable, Map
Class Inheritance
All Implemented Interfaces
java.util.Map, java.io.Serializable, java.lang.Cloneable, org.eclipse.persistence.sessions.DataRecord
Known Direct Subclasses
org.eclipse.persistence.eis.EISMappedRecord, org.eclipse.persistence.oxm.record.XMLRecord, org.eclipse.persistence.sessions.DatabaseRecord
Imports
java.io.*, java.util.*, org.eclipse.persistence.internal.core.sessions.CoreAbstractRecord, org.eclipse.persistence.internal.helper.*, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.sessions.DataRecord

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:

See Also
DatabaseField

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
AbstractRecord.EntrySet

Defines the virtual entrySet.

protected class
AbstractRecord.KeySet

Defines the virtual keySet.

public static class
AbstractRecord.NoEntry

INTERNAL: NoEntry: This is used to differentiate between the two kinds of nulls: no entry exists, and the field is actually mapped to null.

protected static class
AbstractRecord.RecordEntry

Entry class for implementing Map interface.

protected class
AbstractRecord.RecordEntryIterator

Defines the virtual entrySet iterator.

protected class
AbstractRecord.RecordKeyIterator

Defines the virtual keySet iterator.

protected class
AbstractRecord.RecordValuesIterator

Defines the virtual valuesSet iterator.

protected class
AbstractRecord.ValuesSet

Defines the virtual valuesSet.

Field Summary

Modifier and TypeField and Description
protected Vector<DatabaseField>
fields

Use vector to store the fields/values for optimal performance.

protected DatabaseField
lookupField

Optimize field creation for field name lookup.

public static final AbstractRecord.NoEntry
noEntry

INTERNAL: indicator showing that no entry exists for a given key.

protected boolean
nullValueInFields

INTERNAL: flag for any database field containing a null value

protected int
size

PERF: Cache the row size.

protected transient Object
sopObject

INTERNAL: SerializedObjectPolicy support

protected Vector<E>
values

Use vector to store the fields/values for optimal performance.

Constructor Summary

AccessConstructor and Description
protected
AbstractRecord()

INTERNAL: converts JDBC results to collections of rows.

protected
AbstractRecord(int initialCapacity)

INTERNAL: converts JDBC results to collections of rows.

protected
AbstractRecord(Vector<E> fields, Vector<E> values)

INTERNAL: converts JDBC results to collections of rows.

protected
AbstractRecord(Vector<E> fields, Vector<E> values, int size)

INTERNAL: converts JDBC results to collections of rows.

Method Summary

Modifier and TypeMethod and Description
public void
add(DatabaseField key, Object value)

INTERNAL: Add the field-value pair to the row.

public void
clear()

Implements java.util.Map.clear.

PUBLIC: Clear the contents of the row.
public AbstractRecord
clone()

Overrides java.lang.Object.clone.

INTERNAL: Clone the row and its values.
public boolean
contains(Object value)

PUBLIC: Check if the value is contained in the row.

public boolean
containsKey(Object
key whose presence in this map is to be tested
key
)

Implements java.util.Map.containsKey.

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

PUBLIC: Check if the field is contained in the row.

public boolean
containsKey(DatabaseField key)

INTERNAL: Check if the field is contained in the row.

public boolean
containsValue(Object
value whose presence in this map is to be tested
value
)

Implements java.util.Map.containsValue.

PUBLIC: Check if the value is contained in the row.
public Enumeration<E>
elements()

PUBLIC: Returns an Enumeration of the values.

public Set<E>
entrySet()

Implements java.util.Map.entrySet.

PUBLIC: Returns a set of the keys.
public Object
get(Object
the key whose associated value is to be returned
key
)

Implements java.util.Map.get.

PUBLIC: Retrieve the value for the field name.
public Object
get(String fieldName)

PUBLIC: Retrieve the value for the field name.

public Object
get(DatabaseField key)

INTERNAL: Retrieve the value for the field.

public DatabaseField
getField(DatabaseField key)

INTERNAL: Returns the row's field with the same name.

public Vector<DatabaseField>
getFields()

INTERNAL:

public Object
getIndicatingNoEntry(String fieldName)

PUBLIC: Retrieve the value for the field name.

public Object
getIndicatingNoEntry(DatabaseField key)

INTERNAL: Retrieve the value for the field.

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

public Object
getSopObject()

INTERNAL:

public Object
public Object
public Vector<E>
getValues()

INTERNAL:

public boolean
hasNullValueInFields()

INTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.

public boolean
hasSopObject()

INTERNAL:

public boolean
isEmpty()

Implements java.util.Map.isEmpty.

PUBLIC: Return if the row is empty.
public Enumeration<E>
keys()

PUBLIC: Returns an Enumeration of the DatabaseField objects.

public Set<E>
keySet()

Implements java.util.Map.keySet.

PUBLIC: Returns a set of the keys.
public void
mergeFrom(AbstractRecord row)

INTERNAL: Merge the provided row into this row.

public Object
put(Object
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Implements java.util.Map.put.

PUBLIC: Add the field-value pair to the row.
public Object
put(String
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Implements java.util.Map.put.

PUBLIC: Add the field-value pair to the row.
public Object
put(DatabaseField
key with which the specified value is to be associated
key
,
Object
value to be associated with the specified key
value
)

Implements java.util.Map.put.

INTERNAL: Add the field-value pair to the row.
public void
putAll(Map<K, V>
mappings to be stored in this map
map
)

Implements java.util.Map.putAll.

PUBLIC: Add all of the elements.
public Object
remove(Object
key whose mapping is to be removed from the map
key
)

Implements java.util.Map.remove.

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

INTERNAL: Remove the field key from the row.

public Object
remove(DatabaseField key)

INTERNAL: Remove the field key from the row.

public void
replaceAt(Object value, int index)

INTERNAL: replaces the value at index with value

public void
replaceAt(Object value, DatabaseField key)

INTERNAL: replaces the value at field with value

protected void
resetSize()

Reset the row size.

protected void
setFields(Vector<E> fields)

public void
setNullValueInFields(boolean nullValueInFields)

INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwise

public void
setSopObject(Object sopObject)

INTERNAL:

protected void
setValues(Vector<E> values)

public int
size()

Implements java.util.Map.size.

PUBLIC: Return the number of field/value pairs in the row.
public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
public Collection<E>
values()

Implements java.util.Map.values.

PUBLIC: Returns an collection of the values.