Module org.eclipse.persistence.core
Class AbstractRecord
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Defines the virtual entrySet.protected class
Defines the virtual keySet.static class
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
Entry class for implementing Map interface.protected class
Defines the virtual entrySet iterator.protected class
Defines the virtual keySet iterator.protected class
Defines the virtual valuesSet iterator.protected class
Defines the virtual valuesSet. -
Field Summary
Modifier and TypeFieldDescriptionprotected Vector
<DatabaseField> Use vector to store the fields/values for optimal performance.protected DatabaseField
Optimize field creation for field name lookup.static final AbstractRecord.NoEntry
INTERNAL: indicator showing that no entry exists for a given key.protected boolean
INTERNAL: flag for any database field containing a null valueprotected int
PERF: Cache the row size.protected Object
INTERNAL: SerializedObjectPolicy supportprotected Vector
Use vector to store the fields/values for optimal performance. -
Constructor Summary
ModifierConstructorDescriptionprotected
INTERNAL: converts JDBC results to collections of rows.protected
AbstractRecord
(int initialCapacity) INTERNAL: converts JDBC results to collections of rows.protected
AbstractRecord
(Vector fields, Vector values) INTERNAL: converts JDBC results to collections of rows.protected
AbstractRecord
(Vector fields, Vector values, int size) INTERNAL: converts JDBC results to collections of rows. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DatabaseField key, Object value) INTERNAL: Add the field-value pair to the row.void
clear()
PUBLIC: Clear the contents of the row.clone()
INTERNAL: Clone the row and its values.boolean
PUBLIC: Check if the value is contained in the row.boolean
containsKey
(Object key) PUBLIC: Check if the field is contained in the row.boolean
containsKey
(String fieldName) PUBLIC: Check if the field is contained in the row.boolean
containsKey
(DatabaseField key) INTERNAL: Check if the field is contained in the row.boolean
containsValue
(Object value) PUBLIC: Check if the value is contained in the row.elements()
PUBLIC: Returns an Enumeration of the values.entrySet()
PUBLIC: Returns a set of the keys.PUBLIC: Retrieve the value for the field name.PUBLIC: Retrieve the value for the field name.get
(DatabaseField key) INTERNAL: Retrieve the value for the field.getField
(DatabaseField key) INTERNAL: Returns the row's field with the same name.INTERNAL:getIndicatingNoEntry
(String fieldName) PUBLIC: Retrieve the value for the field name.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 checkINTERNAL:INTERNAL:getValues
(DatabaseField key) boolean
INTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.boolean
INTERNAL:boolean
isEmpty()
PUBLIC: Return if the row is empty.keys()
PUBLIC: Returns an Enumeration of the DatabaseField objects.keySet()
PUBLIC: Returns a set of the keys.void
mergeFrom
(AbstractRecord row) INTERNAL: Merge the provided row into this row.PUBLIC: Add the field-value pair to the row.PUBLIC: Add the field-value pair to the row.put
(DatabaseField key, Object value) INTERNAL: Add the field-value pair to the row.void
PUBLIC: Add all of the elements.INTERNAL: Remove the field key from the row.INTERNAL: Remove the field key from the row.remove
(DatabaseField key) INTERNAL: Remove the field key from the row.void
INTERNAL: replaces the value at index with valuevoid
replaceAt
(Object value, DatabaseField key) INTERNAL: replaces the value at field with valueprotected void
Reset the row size.protected void
void
setNullValueInFields
(boolean nullValueInFields) INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwisevoid
setSopObject
(Object sopObject) INTERNAL:protected void
int
size()
PUBLIC: Return the number of field/value pairs in the row.toString()
INTERNAL:values()
PUBLIC: Returns an collection of the values.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
fields
Use vector to store the fields/values for optimal performance. -
values
Use vector to store the fields/values for optimal performance. -
lookupField
Optimize field creation for field name lookup. -
size
protected int sizePERF: Cache the row size. -
noEntry
INTERNAL: indicator showing that no entry exists for a given key. -
nullValueInFields
protected boolean nullValueInFieldsINTERNAL: flag for any database field containing a null value -
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
INTERNAL: converts JDBC results to collections of rows. -
AbstractRecord
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
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. -
clone
INTERNAL: Clone the row and its values. -
contains
PUBLIC: Check if the value is contained in the row. -
containsKey
PUBLIC: Check if the field is contained in the row. Conform to hashtable interface.- Specified by:
containsKey
in interfaceMap
-
containsKey
PUBLIC: Check if the field is contained in the row. -
containsKey
INTERNAL: Check if the field is contained in the row. -
containsValue
PUBLIC: Check if the value is contained in the row.- Specified by:
containsValue
in interfaceMap
-
elements
PUBLIC: Returns an Enumeration of the values. -
entrySet
PUBLIC: Returns a set of the keys. -
get
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. -
get
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
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: 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
INTERNAL: Retrieve the value for the field. If missing null is returned. -
getValues
-
getValues
-
getIndicatingNoEntry
INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned. -
getField
INTERNAL: Returns the row's field with the same name. -
getFields
INTERNAL: -
getValues
INTERNAL: -
isEmpty
public boolean isEmpty()PUBLIC: Return if the row is empty. -
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: Returns an Enumeration of the DatabaseField objects. -
keySet
PUBLIC: Returns a set of the keys. -
mergeFrom
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: Add the field-value pair to the row.- Specified by:
put
in interfaceMap
- Throws:
ValidationException
-
put
PUBLIC: Add the field-value pair to the row. -
put
INTERNAL: Add the field-value pair to the row. -
putAll
PUBLIC: Add all of the elements. -
remove
INTERNAL: Remove the field key from the row. -
remove
INTERNAL: Remove the field key from the row. -
remove
INTERNAL: Remove the field key from the row. -
replaceAt
INTERNAL: replaces the value at index with value -
replaceAt
INTERNAL: replaces the value at field with value -
setFields
-
setNullValueInFields
public void setNullValueInFields(boolean nullValueInFields) INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwise -
setValues
-
size
public int size()PUBLIC: Return the number of field/value pairs in the row. -
toString
INTERNAL: -
values
PUBLIC: Returns an collection of the values. -
hasSopObject
public boolean hasSopObject()INTERNAL: -
getSopObject
INTERNAL: -
setSopObject
INTERNAL:
-