.attachStore(property String, store Store) :void
323507
function (property, store) {

      if (!isStore(store)) {
        throw new Error('Store expected');
      }

      var _this = this;

      store.onChange(function () {
        if (property) {
          _this.setState(property, store.state);
        } else {
          _this.setState(store.state);
        }
      });

      this.onReset(function () {
        store.resetState();
      });

      this.on('storeWillMount', function () {
        store.replaceProps(_this.props);
        store.emit('storeWillMount');
      });

      this.on('storeWillUnmount', function () {
        store.emit('storeWillUnmount');
        store.replaceProps(_this.props);
      });

      this.on('storeWillReceiveProps', function () {
        store.replaceProps(_this.props);
        store.emit('storeWillReceiveProps');
      });
    }
792445
function attachToScope(model, itemsToAttach) {
    var me = this;

    _.each(itemsToAttach, function (item) {
        if (me.pancakes.exists(item, null)) {
            model[item] = me.pancakes.cook(item, null);
        }
    });
}
746723
private void processCollectionStore() {
        String fieldClassName = getDottedClassConstantOperand();
        if (fieldClassName.equals(className) && (stack.getStackDepth() > 0)) {
            OpcodeStack.Item item = stack.getStackItem(0);
            if (item.getUserValue() != null) {
                String fieldName = getNameConstantOperand();
                if (fieldName != null) {
                    FieldInfo fi = collectionFields.get(fieldName);
                    if (fi != null) {
                        fi.getFieldAnnotation().setSourceLines(SourceLineAnnotation.fromVisitedInstruction(this));
                        fi.setSynchronized();
                    }
                }
            }
        }
    }
1073247
function(store, snapshot, url, relationship) {
        var belongsTo = snapshot.belongsTo(relationship.key);
        var belongsToLoaded = belongsTo && !belongsTo.record.get('_internalModel.currentState.isEmpty');

        if(belongsToLoaded) {
          return;
        }

        return this._super(store, snapshot, url, relationship);
      }
1249337
@Override
    public void deleteStoreIfPresent(String storeName) {
        DBConn dbConn = getDBConnection();
        try {
            synchronized (m_schemaLock) {
                if (m_schemaMgr.columnFamilyExists(dbConn, m_keyspace, storeName)) {
                    m_schemaMgr.deleteColumnFamily(dbConn, storeName);
                }
            }
        } finally {
            returnDBConnection(dbConn);
        }
    }
398296
private void replace(PersistentStore store, NodeAVL x, NodeAVL n) {

        if (x.isRoot()) {
            if (n != null) {
                n = n.setParent(store, null);
            }

            store.setAccessor(this, n);
        } else {
            set(store, x.getParent(store), x.isFromLeft(store), n);
        }
    }
709712
void insertIntoTable(Session session, Result result) {

        PersistentStore store = session.sessionData.getRowStore(this);
        RowSetNavigator nav   = result.initialiseNavigator();

        while (nav.hasNext()) {
            Object[] data = nav.getNext();
            Object[] newData =
                (Object[]) ArrayUtil.resizeArrayIfDifferent(data,
                    getColumnCount());

            insertData(store, newData);
        }
    }
664839
def existingInStore(cls, store, storeID, attrs):
        """"""
        self = cls.__new__(cls)

        self.__justCreated = False
        self.__subinit__(__store=store,
                         storeID=storeID,
                         __everInserted=True)

        schema = self.getSchema()
        assert len(schema) == len(attrs), "invalid number of attributes"
        for data, (name, attr) in zip(attrs, schema):
            attr.loaded(self, data)
        self.activate()
        return self
858754
def _attachToObject(self, anchorObj, relationName) :
		""
		#MutableSequence.__getattribute__(self, "develop")()
		self.develop()
		self._attachToObject(anchorObj, relationName)
1106335
def createStore(self, debug, journalMode=None):
        
        if self.storepath is None:
            self.store._memorySubstores.append(self) # don't fall out of cache
            if self.store.filesdir is None:
                filesdir = None
            else:
                filesdir = (self.store.filesdir.child("_substore_files")
                                               .child(str(self.storeID))
                                               .path)
            return Store(parent=self.store,
                         filesdir=filesdir,
                         idInParent=self.storeID,
                         debug=debug,
                         journalMode=journalMode)
        else:
            return Store(self.storepath.path,
                         parent=self.store,
                         idInParent=self.storeID,
                         debug=debug,
                         journalMode=journalMode)
385714
function (store, type, fixtureRecord) {
    var fixture, fixturesArray;
    if (fixtureRecord.id) {
      fixture = this.fixtureForId(store, type, fixtureRecord.id);
      if (fixture) {
        fixturesArray = this.fixturesForType(store, type);
        fixturesArray.splice(fixturesArray.indexOf(fixtureRecord), 1);
      }
    }
    else {
      throw new Error('Deleting a fixture requires an ID.');
    }
    return null;
  }
410539
void insert(boolean readOnly, int generation) throws PersistException {
        if (mAllProperties == null) {
            throw new IllegalStateException();
        }

        mStoredLayout.setGeneration(generation);

        if (readOnly) {
            return;
        }

        try {
            mStoredLayout.insert();
        } catch (UniqueConstraintException e) {
            // If existing record logically matches, update to allow replication.
            StoredLayout existing = mStoredLayout.prepare();
            mStoredLayout.copyPrimaryKeyProperties(existing);
            try {
                existing.load();
            } catch (FetchException e2) {
                throw e2.toPersistException();
            }
            if (existing.getGeneration() != generation ||
                !existing.getStorableTypeName().equals(getStorableTypeName()) ||
                !Arrays.equals(existing.getExtraData(), mStoredLayout.getExtraData()))
            {
                throw e;
            }
            mStoredLayout.setVersionNumber(existing.getVersionNumber());
            mStoredLayout.update();
        }

        for (LayoutProperty property : mAllProperties) {
            property.insert();
        }
    }
335479
function(persist) {
          /**
          * is Persistant or not
          * @property {boolean} isPersisted Persistant property
          * @memberof AbstractLocalStorage
          */
          this.isPersisted = persist;

          this.myStore = null;
          /**
          * Is storage supported
          * @method isSupported
          * @memberof AbstractLocalStorage
          * @returns {boolean} Returns true if supported
          */
          this.isSupported = function() {
            return (typeof (Storage) !== "undefined");
          };

          // true = localStorage, false = sessionStorage
          if (this.isSupported()) {
            //logger.debug("AUGMENTED: localStorage exists");

            if (this.isPersisted) {
              this.myStore = localStorage;
            } else {
              this.myStore = sessionStorage;
            }
          } else {
            logger.warn("AUGMENTED: No localStorage.");
          }

          /**
          * Gets an item from storage
          * @method getItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @returns {object} Returns object from storage
          */
          this.getItem = function(itemKey) {
            var item = this.myStore.getItem(itemKey);
            if (item) {
              return JSON.parse(item);
            }
            return null;
          };

          /**
          * Sets an item to storage
          * @method setItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @param {object} object The data to set
          */
          this.setItem = function(itemKey, object) {
            this.myStore.setItem(itemKey, JSON.stringify(object));
          };

          /**
          * Removes an item from storage
          * @method removeItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          */
          this.removeItem = function(itemKey) {
            this.myStore.removeItem(itemKey);
          };

          /**
          * Clears storage - <b>Warning: Destructive in non-namespaced instances!</b>
          * @method clear
          * @memberof AbstractLocalStorage
          */
          this.clear = function() {
            this.myStore.clear();
          };

          /**
          * Gets the key from storage for index
          * @method key
          * @memberof AbstractLocalStorage
          * @param {number} i The index in storage
          * @returns {string} Returns the key from storage
          */
          this.key = function(i) {
            return this.myStore.key(i);
          };

          /**
          * The length of storage by keys
          * @method length
          * @memberof AbstractLocalStorage
          * @returns {number} Returns the length of storage by keys
          */
          this.length = function() {
            return this.myStore.length;
          };
        }
541770
function connectStore(modules) {
  var mapStateToProps = function mapStateToProps(state, props) {
    var finalState = {};
    Object.keys(modules).forEach(function (key) {
      var moduleInstance = modules[key];
      var module_name = moduleInstance.module && moduleInstance.module.name || moduleInstance.name;
      var stateObj = state[module_name];
      if (moduleInstance.get) {
        var filter_array = moduleInstance.get.split(",");
        stateObj = (0, _helpers.pluck)(stateObj, filter_array);
      }
      stateObj = attachModuleSelectors(moduleInstance, stateObj, state, props);
      finalState[key] = stateObj;
    });
    return finalState;
  };

  var mapDispatchToProps = function mapDispatchToProps(dispatch) {
    var finalProps = {};
    Object.keys(modules).forEach(function (key) {
      var moduleInstance = modules[key];
      var actions_obj = {};
      var module_actions = moduleInstance.module && moduleInstance.module.actions || moduleInstance.actions;
      if (module_actions) {
        Object.keys(module_actions).forEach(function (action_key) {
          var action = module_actions[action_key];
          actions_obj[action_key] = function () {
            return dispatch(action.apply(undefined, arguments));
          };
        });
        finalProps[key] = actions_obj;
      }
    });
    return finalProps;
  };
  var mergeProps = function mergeProps(state, actions, ownProps) {
    var finalModule = {};
    Object.keys(state).forEach(function (key) {
      var module_state = state[key];
      var module_actions = actions[key];
      finalModule[key] = Object.assign({}, module_state, module_actions);
    });
    return Object.assign({}, finalModule, ownProps);
  };
  return (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps, {
    pure: true,
    areStatePropsEqual: function areStatePropsEqual(a, b) {
      return (0, _helpers.areSame)(a, b);
    }
  });
}
622080
private void registerObject(DigitalObject obj)
            throws StorageDeviceException {
        String pid = obj.getPid();
        String userId = "the userID field is no longer used";
        String label = "the label field is no longer used";

        Connection conn = null;
        PreparedStatement s1 = null;
        try {
            String query =
                    "INSERT INTO doRegistry (doPID, ownerId, label) VALUES (?, ?, ?)";
            conn = m_connectionPool.getReadWriteConnection();
            s1 = conn.prepareStatement(query);
            s1.setString(1,pid);
            s1.setString(2,userId);
            s1.setString(3, label);
            s1.executeUpdate();

            if (obj.hasContentModel(Models.SERVICE_DEPLOYMENT_3_0)){
                updateDeploymentMap(obj, conn);
            }
        } catch (SQLException sqle) {
            throw new StorageDeviceException("Unexpected error from SQL database while registering object: "
                    + sqle.getMessage(), sqle);
        } finally {
            try {
                if (s1 != null) {
                    s1.close();
                }
            } catch (Exception sqle) {
                throw new StorageDeviceException("Unexpected error from SQL database while registering object: "
                        + sqle.getMessage(), sqle);
            } finally {
                s1 = null;
            }
        }

        PreparedStatement s2 = null;
        ResultSet results = null;
        try {
            // REGISTRY:
            // update systemVersion in doRegistry (add one)
            logger.debug("COMMIT: Updating registry...");
            String query =
                    "SELECT systemVersion FROM doRegistry WHERE doPID=?";
            s2 = conn.prepareStatement(query);
            s2.setString(1, pid);
            results = s2.executeQuery();
            if (!results.next()) {
                throw new ObjectNotFoundException("Error creating replication job: The requested object doesn't exist in the registry.");
            }
            int systemVersion = results.getInt("systemVersion");
            systemVersion++;
            query = "UPDATE doRegistry SET systemVersion=? WHERE doPID=?";
            s2.close();
            s2 = conn.prepareStatement(query);
            s2.setInt(1, systemVersion);
            s2.setString(2,pid);
            s2.executeUpdate();
        } catch (SQLException sqle) {
            throw new StorageDeviceException("Error creating replication job: "
                    + sqle.getMessage());
        } catch (ObjectNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
                if (s2 != null) {
                    s2.close();
                }
                if (conn != null) {
                    m_connectionPool.free(conn);
                }
            } catch (SQLException sqle) {
                throw new StorageDeviceException("Unexpected error from SQL database: "
                        + sqle.getMessage());
            } finally {
                results = null;
                s2 = null;
            }
        }
    }
301441
function attach(listener) {
    if (!listener) return;
    if (!listener[CONTEXTS_SYMBOL]) listener[CONTEXTS_SYMBOL] = Object.create(null);

    listener[CONTEXTS_SYMBOL][thisSymbol] = {
      namespace : namespace,
      context   : namespace.active
    };
  }
377537
function bind(text, fn, store) {
  var data = store.data;
  var tmpl = mouth(text, store.data);
  var cb = tmpl[0];
  var keys = tmpl[1];
  fn(cb(store.data));
  for(var l = keys.length; l--;) {
    store.on('change ' + keys[l], function() {
      fn(cb(store.data));
    });
  }
}