Class SimpleResultSetRecord

All Implemented Interfaces:
Serializable, Cloneable, Map, DataRecord

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:
  • Field Details

    • 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 Details

  • Method Details

    • loadAllValuesFromResultSet

      public void loadAllValuesFromResultSet()
      Obtains all the value from resultSet and removes it. resultSet must be non null.
      Overrides:
      loadAllValuesFromResultSet in class ResultSetRecord
    • get

      public Object get(DatabaseField key)
      INTERNAL: Retrieve the value for the field. If missing null is returned.
      Overrides:
      get in class ResultSetRecord
    • 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 class ResultSetRecord
    • 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 class ResultSetRecord
    • setSopObject

      public void setSopObject(Object sopObject)
      Description copied from class: AbstractRecord
      INTERNAL:
      Overrides:
      setSopObject in class ResultSetRecord