Class SimpleResultSetRecord
- 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
-
- org.eclipse.persistence.internal.sessions.SimpleResultSetRecord
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
,Record
public class SimpleResultSetRecord extends ResultSetRecord
PERF: Record used by ObjectLevelReadQuery ResultSet optimization. This is a subclass of ResultSetRecord that's used with simple descriptors (descriptor.getObjectBuilder().isSimple()) - those having only DirectToField mappings. In this case the record is not cached by any mapping therefore could be reused in ReadAllQuery - (which calls resultSet.next()). 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 are nullified after use.- 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 boolean
isPopulatingObject
Indicates that the whole object is being populated.protected boolean
shouldKeepValues
Indicates whether the values requested while populating object (isPopulatingObject == true) should be saved in valuesArrayprotected boolean
shouldUseOptimization
Indicates whether to use optimization while getting values from result set instead of calling accessor.getObject method.-
Fields inherited from class org.eclipse.persistence.internal.sessions.ResultSetRecord
accessor, metaData, optimizeData, platform, resultSet, session
-
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 protected
SimpleResultSetRecord()
SimpleResultSetRecord(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 Object
get(DatabaseField key)
INTERNAL: Retrieve the value for the field.Object
getIndicatingNoEntry(DatabaseField key)
INTERNAL: Retrieve the value for the field.protected Object
getValueFromResultSet(int index, DatabaseField field)
boolean
hasValues()
boolean
isPopulatingObject()
void
loadAllValuesFromResultSet()
Obtains all the value from resultSet and removes it.void
reset()
void
setShouldKeepValues(boolean shouldKeepValues)
void
setShouldUseOptimization(boolean shouldUseOptimization)
void
setSopObject(Object sopObject)
INTERNAL:boolean
shouldKeepValues()
boolean
shouldUseOptimization()
protected String
toStringAditional()
-
Methods inherited from class org.eclipse.persistence.internal.sessions.ResultSetRecord
checkValues, clear, containsValue, hasResultSet, removAllValue, removeNonIndirectionValues, removeResultSet
-
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
-
shouldKeepValues
protected transient boolean shouldKeepValues
Indicates whether the values requested while populating object (isPopulatingObject == true) should be saved in valuesArray
-
shouldUseOptimization
protected transient boolean shouldUseOptimization
Indicates whether to use optimization while getting values from result set instead of calling accessor.getObject method.
-
isPopulatingObject
protected transient boolean isPopulatingObject
Indicates that the whole object is being populated. At first the primary key is extracted from the row - to see if the object with the same pk is already in the cache. Then in case of refresh the locking field value is extracted, too. Indication of the object being populated from the record (looping through all the mappings) is request for a value, which has been already returned before (usually primary key, but may be version). At this point the flag is set to true.
-
-
Constructor Detail
-
SimpleResultSetRecord
protected SimpleResultSetRecord()
-
SimpleResultSetRecord
public SimpleResultSetRecord(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.- Overrides:
loadAllValuesFromResultSet
in classResultSetRecord
-
get
public Object get(DatabaseField key)
INTERNAL: Retrieve the value for the field. If missing null is returned.- Overrides:
get
in classResultSetRecord
-
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:
getIndicatingNoEntry
in classResultSetRecord
-
getValueFromResultSet
protected Object getValueFromResultSet(int index, DatabaseField field)
-
reset
public void reset()
-
shouldKeepValues
public boolean shouldKeepValues()
-
setShouldKeepValues
public void setShouldKeepValues(boolean shouldKeepValues)
-
shouldUseOptimization
public boolean shouldUseOptimization()
-
setShouldUseOptimization
public void setShouldUseOptimization(boolean shouldUseOptimization)
-
hasValues
public boolean hasValues()
-
isPopulatingObject
public boolean isPopulatingObject()
-
toStringAditional
protected String toStringAditional()
- Overrides:
toStringAditional
in classResultSetRecord
-
setSopObject
public void setSopObject(Object sopObject)
Description copied from class:AbstractRecord
INTERNAL:- Overrides:
setSopObject
in classResultSetRecord
-
-