Module org.eclipse.persistence.core
Class ResultSetRecord
- 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
-
- org.eclipse.persistence.internal.sessions.ResultSetRecord
-
- All Implemented Interfaces:
Serializable,Cloneable,Map,DataRecord
- Direct Known Subclasses:
SimpleResultSetRecord
public class ResultSetRecord extends ArrayRecord
PERF: Record used by ObjectLevelReadQuery ResultSet optimization. The record corresponds to a single position (resultSet.next() is never called). In case the cached object used instead of creating a new one from the record, the not needed fields' values are never obtained from resultSet (that's especially important for expensive LOBs). If alternatively the record is used to populate an object then all the values obtained from resultSet and resultSet is nullified. In this case the fields' values not required after object population (those not involved in indirection) are nullified to save space in the record.- 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 DatabaseAccessoraccessorprotected ResultSetMetaDatametaDataprotected booleanoptimizeDataprotected DatabasePlatformplatformprotected ResultSetresultSetprotected AbstractSessionsession-
Fields inherited from class org.eclipse.persistence.internal.sessions.ArrayRecord
fieldsArray, valuesArray
-
Fields inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord
fields, lookupField, noEntry, nullValueInFields, size, sopObject, values
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResultSetRecord()ResultSetRecord(Vector fields, DatabaseField[] fieldsArray, ResultSet resultSet, ResultSetMetaData metaData, DatabaseAccessor accessor, AbstractSession session, DatabasePlatform platform, boolean optimizeData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckValues()Reset the fields and values from the arrays.voidclear()PUBLIC: Clear the contents of 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.ObjectgetIndicatingNoEntry(DatabaseField key)INTERNAL: Retrieve the value for the field.booleanhasResultSet()Indicates whether resultSet is still here.voidloadAllValuesFromResultSet()Obtains all the value from resultSet and removes it.voidremovAllValue()voidremoveNonIndirectionValues()Remove values corresponding to all fields not related to indirection.voidremoveResultSet()voidsetSopObject(Object sopObject)INTERNAL:protected StringtoStringAditional()-
Methods inherited from class org.eclipse.persistence.internal.sessions.ArrayRecord
add, clone, containsKey, getField, getFields, getValues, put, remove, replaceAt, replaceAt, setFields, setValues, size, toString
-
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, 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
-
resultSet
protected transient ResultSet resultSet
-
metaData
protected transient ResultSetMetaData metaData
-
accessor
protected transient DatabaseAccessor accessor
-
platform
protected transient DatabasePlatform platform
-
optimizeData
protected transient boolean optimizeData
-
session
protected transient AbstractSession session
-
-
Constructor Detail
-
ResultSetRecord
protected ResultSetRecord()
-
ResultSetRecord
public ResultSetRecord(Vector fields, DatabaseField[] fieldsArray, ResultSet resultSet, ResultSetMetaData metaData, DatabaseAccessor accessor, AbstractSession session, DatabasePlatform platform, boolean optimizeData)
-
-
Method Detail
-
loadAllValuesFromResultSet
public void loadAllValuesFromResultSet()
Obtains all the value from resultSet and removes it. resultSet must be non null.
-
removeNonIndirectionValues
public void removeNonIndirectionValues()
Remove values corresponding to all fields not related to indirection.
-
removAllValue
public void removAllValue()
-
hasResultSet
public boolean hasResultSet()
Indicates whether resultSet is still here.
-
removeResultSet
public void removeResultSet()
-
clear
public void clear()
PUBLIC: Clear the contents of the row.- Specified by:
clearin interfaceMap- Overrides:
clearin classArrayRecord
-
checkValues
protected void checkValues()
Reset the fields and values from the arrays. This removes the optimization if a non-optimized method is called.- Overrides:
checkValuesin classArrayRecord
-
containsValue
public boolean containsValue(Object value)
PUBLIC: Check if the value is contained in the row.- Specified by:
containsValuein interfaceMap- Overrides:
containsValuein classArrayRecord
-
get
public Object get(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing null is returned.- Overrides:
getin classArrayRecord
-
getIndicatingNoEntry
public Object getIndicatingNoEntry(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned. PERF: This method is a clone of get() for performance.- Overrides:
getIndicatingNoEntryin classArrayRecord
-
toStringAditional
protected String toStringAditional()
- Overrides:
toStringAditionalin classArrayRecord
-
setSopObject
public void setSopObject(Object sopObject)
Description copied from class:AbstractRecordINTERNAL:- Overrides:
setSopObjectin classAbstractRecord
-
-