Module org.eclipse.persistence.core
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,DataRecord
- 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[]fieldsArrayprotected 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 protectedArrayRecord()ArrayRecord(Vector fields, DatabaseField[] fieldsArray, Object[] valuesArray)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DatabaseField key, Object value)INTERNAL: Add the field-value pair to the row.protected voidcheckValues()Reset the fields and values from the arrays.voidclear()PUBLIC: Clear the contents of the row.AbstractRecordclone()INTERNAL: Clone the row and its values.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.Objectget(DatabaseField key)INTERNAL: Retrieve the value for the field.DatabaseFieldgetField(DatabaseField key)INTERNAL: Returns the row's field with the same name.VectorgetFields()INTERNAL:ObjectgetIndicatingNoEntry(DatabaseField key)INTERNAL: Retrieve the value for the field.VectorgetValues()INTERNAL:Objectput(DatabaseField key, Object value)INTERNAL: Add the field-value pair to the row.Objectremove(DatabaseField key)INTERNAL: Remove the field key from the row.voidreplaceAt(Object value, int index)INTERNAL: replaces the value at index with valuevoidreplaceAt(Object value, DatabaseField key)INTERNAL: replaces the value at field with valueprotected voidsetFields(Vector fields)protected voidsetValues(Vector values)intsize()PUBLIC: Return the number of field/value pairs in the row.StringtoString()INTERNAL:protected StringtoStringAditional()-
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:
addin classAbstractRecord
-
clear
public void clear()
PUBLIC: Clear the contents of the row.- Specified by:
clearin interfaceMap- Overrides:
clearin classAbstractRecord
-
clone
public AbstractRecord clone()
INTERNAL: Clone the row and its values.- Overrides:
clonein classAbstractRecord
-
containsKey
public boolean containsKey(DatabaseField key)
INTERNAL: Check if the field is contained in the row.- Overrides:
containsKeyin classAbstractRecord
-
containsValue
public boolean containsValue(Object value)
PUBLIC: Check if the value is contained in the row.- Specified by:
containsValuein interfaceMap- Overrides:
containsValuein classAbstractRecord
-
get
public Object get(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing null is returned.- Overrides:
getin classAbstractRecord
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned.- Overrides:
getIndicatingNoEntryin classAbstractRecord
-
getField
public DatabaseField getField(DatabaseField key)
INTERNAL: Returns the row's field with the same name.- Overrides:
getFieldin classAbstractRecord
-
getFields
public Vector getFields()
INTERNAL:- Overrides:
getFieldsin classAbstractRecord
-
getValues
public Vector getValues()
INTERNAL:- Overrides:
getValuesin classAbstractRecord
-
put
public Object put(DatabaseField key, Object value)
INTERNAL: Add the field-value pair to the row.- Overrides:
putin classAbstractRecord
-
remove
public Object remove(DatabaseField key)
INTERNAL: Remove the field key from the row.- Overrides:
removein classAbstractRecord
-
replaceAt
public void replaceAt(Object value, int index)
INTERNAL: replaces the value at index with value- Overrides:
replaceAtin classAbstractRecord
-
replaceAt
public void replaceAt(Object value, DatabaseField key)
INTERNAL: replaces the value at field with value- Overrides:
replaceAtin classAbstractRecord
-
setFields
protected void setFields(Vector fields)
- Overrides:
setFieldsin classAbstractRecord
-
setValues
protected void setValues(Vector values)
- Overrides:
setValuesin classAbstractRecord
-
size
public int size()
PUBLIC: Return the number of field/value pairs in the row.- Specified by:
sizein interfaceMap- Overrides:
sizein classAbstractRecord
-
toString
public String toString()
Description copied from class:AbstractRecordINTERNAL:- Overrides:
toStringin classAbstractRecord
-
toStringAditional
protected String toStringAditional()
-
-