def load_reference(attribute)
      ldr = database.lazy_loader
      # bypass the singleton method and call the class instance method if the lazy loader is disabled
      return transient_value(attribute) unless ldr.enabled?
      
      # First disable lazy loading for the attribute, since the reader method is called by the loader.
      remove_lazy_loader(attribute)
      # load the fetched value
      merged = ldr.load(self, attribute)
      
      # update dependent snapshots if necessary
      pa = self.class.property(attribute)
      if pa.dependent? then
        # the owner attribute
        oattr = pa.inverse
        if oattr then
          # update dependent snapshot with the owner, since the owner snapshot is taken when fetched but the
          # owner might be set when the fetched dependent is merged into the owner dependent attribute. 
          merged.enumerate do |dep|
            if dep.fetched? then
              dep.snapshot[oattr] = self
              logger.debug { "Updated the #{qp} fetched #{attribute} dependent #{dep.qp} snapshot with #{oattr} value #{qp}." }
            end
          end
        end
      end

      merged
    end
def load_reference(attribute)
      ldr = database.lazy_loader
      # bypass the singleton method and call the class instance method if the lazy loader is disabled
      return transient_value(attribute) unless ldr.enabled?
      
      # First disable lazy loading for the attribute, since the reader method is called by the loader.
      remove_lazy_loader(attribute)
      # load the fetched value
      merged = ldr.load(self, attribute)
      
      # update dependent snapshots if necessary
      pa = self.class.property(attribute)
      if pa.dependent? then
        # the owner attribute
        oattr = pa.inverse
        if oattr then
          # update dependent snapshot with the owner, since the owner snapshot is taken when fetched but the
          # owner might be set when the fetched dependent is merged into the owner dependent attribute. 
          merged.enumerate do |dep|
            if dep.fetched? then
              dep.snapshot[oattr] = self
              logger.debug { "Updated the #{qp} fetched #{attribute} dependent #{dep.qp} snapshot with #{oattr} value #{qp}." }
            end
          end
        end
      end

      merged
    end
Loads the reference attribute database value into this Persistable.

 @param [Symbol] attribute the attribute to load
 @return the attribute value merged from the database value