Class 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
    • 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.
    • Method Detail

      • loadAllValuesFromResultSet

        public void loadAllValuesFromResultSet()
        Obtains all the value from resultSet and removes it. resultSet must be non null.
        Overrides:
        loadAllValuesFromResultSet 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()