Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions

public Class SimpleResultSetRecord

extends ResultSetRecord
Class Inheritance
Imports
java.sql.ResultSet, .ResultSetMetaData, .SQLException, java.util.Vector, org.eclipse.persistence.exceptions.DatabaseException, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor, .DatabasePlatform, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField

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.

Field Summary

Modifier and TypeField and Description
protected transient boolean
isPopulatingObject

Indicates that the whole object is being populated.

protected transient boolean
shouldKeepValues

Indicates whether the values requested while populating object (isPopulatingObject == true) should be saved in valuesArray

protected transient boolean
shouldUseOptimization

Indicates whether to use optimization while getting values from result set instead of calling accessor.getObject method.

Inherited from org.eclipse.persistence.internal.sessions.ResultSetRecord:
accessormetaDataoptimizeDataplatformresultSetsession

Constructor Summary

AccessConstructor and Description
protected
public
SimpleResultSetRecord(Vector<E> fields, DatabaseField[] fieldsArray, ResultSet resultSet, ResultSetMetaData metaData, DatabaseAccessor accessor, AbstractSession session, DatabasePlatform platform, boolean optimizeData)

Method Summary

Modifier and TypeMethod and Description
public Object
get(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.get.

INTERNAL: Retrieve the value for the field.
public Object
protected Object
public boolean
public boolean
public void
public void
public void
setShouldKeepValues(boolean shouldKeepValues)

public void
setShouldUseOptimization(boolean shouldUseOptimization)

public void
public boolean
public boolean
protected String
Inherited from org.eclipse.persistence.internal.sessions.ResultSetRecord:
checkValuesclearcontainsValuehasResultSetremovAllValueremoveNonIndirectionValuesremoveResultSet

Field Detail

isPopulatingObjectback to summary
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.

shouldKeepValuesback to summary
protected transient boolean shouldKeepValues

Indicates whether the values requested while populating object (isPopulatingObject == true) should be saved in valuesArray

shouldUseOptimizationback to summary
protected transient boolean shouldUseOptimization

Indicates whether to use optimization while getting values from result set instead of calling accessor.getObject method.

Constructor Detail

SimpleResultSetRecordback to summary
protected SimpleResultSetRecord()
SimpleResultSetRecordback to summary
public SimpleResultSetRecord(Vector<E> fields, DatabaseField[] fieldsArray, ResultSet resultSet, ResultSetMetaData metaData, DatabaseAccessor accessor, AbstractSession session, DatabasePlatform platform, boolean optimizeData)

Method Detail

getback to summary
public Object get(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.get.

INTERNAL: Retrieve the value for the field. If missing null is returned.

Annotations
@Override
getIndicatingNoEntryback to summary
public Object getIndicatingNoEntry(DatabaseField key)

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.getIndicatingNoEntry.

INTERNAL: Retrieve the value for the field. If missing DatabaseRow.noEntry is returned. PERF: This method is a clone of get() for performance.

Annotations
@Override
getValueFromResultSetback to summary
protected Object getValueFromResultSet(int index, DatabaseField field)
hasValuesback to summary
public boolean hasValues()
isPopulatingObjectback to summary
public boolean isPopulatingObject()
loadAllValuesFromResultSetback to summary
public void loadAllValuesFromResultSet()

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.loadAllValuesFromResultSet.

Obtains all the value from resultSet and removes it. resultSet must be non null.

Annotations
@Override
resetback to summary
public void reset()
setShouldKeepValuesback to summary
public void setShouldKeepValues(boolean shouldKeepValues)
setShouldUseOptimizationback to summary
public void setShouldUseOptimization(boolean shouldUseOptimization)
setSopObjectback to summary
public void setSopObject(Object sopObject)

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.setSopObject.

Doc from org.eclipse.persistence.internal.sessions.AbstractRecord.setSopObject.

INTERNAL:

Annotations
@Override
shouldKeepValuesback to summary
public boolean shouldKeepValues()
shouldUseOptimizationback to summary
public boolean shouldUseOptimization()
toStringAditionalback to summary
protected String toStringAditional()

Overrides org.eclipse.persistence.internal.sessions.ResultSetRecord.toStringAditional.

Annotations
@Override