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
Nested ClassesModifier and TypeClassDescriptionprotected classDefines the virtual entrySet.protected classDefines the virtual keySet.static classINTERNAL: 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 classEntry class for implementing Map interface.protected classDefines the virtual entrySet iterator.protected classDefines the virtual keySet iterator.protected classDefines the virtual valuesSet iterator.protected classDefines the virtual valuesSet. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<DatabaseField> Use vector to store the fields/values for optimal performance.protected DatabaseFieldOptimize field creation for field name lookup.static final AbstractRecord.NoEntryINTERNAL: indicator showing that no entry exists for a given key.protected booleanINTERNAL: flag for any database field containing a null valueprotected intPERF: Cache the row size.protected ObjectINTERNAL: SerializedObjectPolicy supportprotected VectorUse vector to store the fields/values for optimal performance. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedINTERNAL: converts JDBC results to collections of rows.protectedAbstractRecord(int initialCapacity) INTERNAL: converts JDBC results to collections of rows.protectedAbstractRecord(Vector fields, Vector values) INTERNAL: converts JDBC results to collections of rows.protectedAbstractRecord(Vector fields, Vector values, int size) INTERNAL: converts JDBC results to collections of rows. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DatabaseField key, Object value) INTERNAL: Add the field-value pair to the row.voidclear()PUBLIC: Clear the contents of the row.clone()INTERNAL: Clone the row and its values.booleanPUBLIC: Check if the value is contained in the row.booleancontainsKey(Object key) PUBLIC: Check if the field is contained in the row.booleancontainsKey(String fieldName) PUBLIC: Check if the field is contained in the row.booleancontainsKey(DatabaseField key) INTERNAL: Check if the field is contained in the row.booleancontainsValue(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 DatabaseFieldgetLookupField(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) booleanINTERNAL: Return true if the AbstractRecord has been marked as valid to check the update call cache with, false otherwise.booleanINTERNAL:booleanisEmpty()PUBLIC: Return if the row is empty.keys()PUBLIC: Returns an Enumeration of the DatabaseField objects.keySet()PUBLIC: Returns a set of the keys.voidmergeFrom(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.voidPUBLIC: 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.voidINTERNAL: replaces the value at index with valuevoidreplaceAt(Object value, DatabaseField key) INTERNAL: replaces the value at field with valueprotected voidReset the row size.protected voidvoidsetNullValueInFields(boolean nullValueInFields) INTERNAL: Set the validForUpdateCallCacheCheck attribute to true if the row does not contain nulls, false otherwisevoidsetSopObject(Object sopObject) INTERNAL:protected voidintsize()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, waitMethods 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:
containsKeyin 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:
containsValuein 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:
putin 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:
-