Class ArrayRecord
- java.lang.Object
-
- org.eclipse.persistence.internal.core.sessions.CoreAbstractRecord
-
- org.eclipse.persistence.internal.sessions.AbstractRecord
-
- org.eclipse.persistence.sessions.DatabaseRecord
-
- org.eclipse.persistence.internal.sessions.ArrayRecord
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
,Record
- Direct Known Subclasses:
ResultSetRecord
public class ArrayRecord extends DatabaseRecord
PERF: Optimized record implementation using arrays instead of Vector. Currently only used when fetch rows from the database.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
AbstractRecord.EntrySet, AbstractRecord.KeySet, AbstractRecord.NoEntry, AbstractRecord.RecordEntry, AbstractRecord.RecordEntryIterator, AbstractRecord.RecordKeyIterator, AbstractRecord.RecordValuesIterator, AbstractRecord.ValuesSet
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseField[]
fieldsArray
protected Object[]
valuesArray
-
Fields inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
fields, lookupField, noEntry, nullValueInFields, size, sopObject, values
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ArrayRecord()
ArrayRecord(Vector fields, DatabaseField[] fieldsArray, Object[] valuesArray)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(DatabaseField key, Object value)
INTERNAL: Add the field-value pair to the row.protected void
checkValues()
Reset the fields and values from the arrays.void
clear()
PUBLIC: Clear the contents of the row.AbstractRecord
clone()
INTERNAL: Clone the row and its values.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.Object
get(DatabaseField key)
INTERNAL: Retrieve the value for the field.DatabaseField
getField(DatabaseField key)
INTERNAL: Returns the row's field with the same name.Vector
getFields()
INTERNAL:Object
getIndicatingNoEntry(DatabaseField key)
INTERNAL: Retrieve the value for the field.Vector
getValues()
INTERNAL:Object
put(DatabaseField key, Object value)
INTERNAL: Add the field-value pair to the row.Object
remove(DatabaseField key)
INTERNAL: Remove the field key from the row.void
replaceAt(Object value, int index)
INTERNAL: replaces the value at index with valuevoid
replaceAt(Object value, DatabaseField key)
INTERNAL: replaces the value at field with valueprotected void
setFields(Vector fields)
protected void
setValues(Vector values)
int
size()
PUBLIC: Return the number of field/value pairs in the row.String
toString()
INTERNAL:protected String
toStringAditional()
-
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
contains, containsKey, containsKey, elements, entrySet, get, get, getIndicatingNoEntry, getLookupField, getSopObject, getValues, getValues, hasNullValueInFields, hasSopObject, isEmpty, keys, keySet, mergeFrom, put, put, putAll, remove, remove, resetSize, setNullValueInFields, setSopObject, 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 Detail
-
fieldsArray
protected DatabaseField[] fieldsArray
-
valuesArray
protected Object[] valuesArray
-
-
Constructor Detail
-
ArrayRecord
protected ArrayRecord()
-
ArrayRecord
public ArrayRecord(Vector fields, DatabaseField[] fieldsArray, Object[] valuesArray)
-
-
Method Detail
-
checkValues
protected void checkValues()
Reset the fields and values from the arrays. This removes the optimization if a non-optimized method is called.
-
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- Overrides:
add
in classAbstractRecord
-
clear
public void clear()
PUBLIC: Clear the contents of the row.- Specified by:
clear
in interfaceMap
- Overrides:
clear
in classAbstractRecord
-
clone
public AbstractRecord clone()
INTERNAL: Clone the row and its values.- Overrides:
clone
in classAbstractRecord
-
containsKey
public boolean containsKey(DatabaseField key)
INTERNAL: Check if the field is contained in the row.- Overrides:
containsKey
in classAbstractRecord
-
containsValue
public boolean containsValue(Object value)
PUBLIC: Check if the value is contained in the row.- Specified by:
containsValue
in interfaceMap
- Overrides:
containsValue
in classAbstractRecord
-
get
public Object get(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing null is returned.- Overrides:
get
in classAbstractRecord
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.- Overrides:
getIndicatingNoEntry
in classAbstractRecord
-
getField
public DatabaseField getField(DatabaseField key)
INTERNAL: Returns the row's field with the same name.- Overrides:
getField
in classAbstractRecord
-
getFields
public Vector getFields()
INTERNAL:- Overrides:
getFields
in classAbstractRecord
-
getValues
public Vector getValues()
INTERNAL:- Overrides:
getValues
in classAbstractRecord
-
put
public Object put(DatabaseField key, Object value)
INTERNAL: Add the field-value pair to the row.- Overrides:
put
in classAbstractRecord
-
remove
public Object remove(DatabaseField key)
INTERNAL: Remove the field key from the row.- Overrides:
remove
in classAbstractRecord
-
replaceAt
public void replaceAt(Object value, int index)
INTERNAL: replaces the value at index with value- Overrides:
replaceAt
in classAbstractRecord
-
replaceAt
public void replaceAt(Object value, DatabaseField key)
INTERNAL: replaces the value at field with value- Overrides:
replaceAt
in classAbstractRecord
-
setFields
protected void setFields(Vector fields)
- Overrides:
setFields
in classAbstractRecord
-
setValues
protected void setValues(Vector values)
- Overrides:
setValues
in classAbstractRecord
-
size
public int size()
PUBLIC: Return the number of field/value pairs in the row.- Specified by:
size
in interfaceMap
- Overrides:
size
in classAbstractRecord
-
toString
public String toString()
Description copied from class:AbstractRecord
INTERNAL:- Overrides:
toString
in classAbstractRecord
-
toStringAditional
protected String toStringAditional()
-
-