Initializes the collection by loading its contents from the database
if the collection is not yet initialized.
510670
public function initialize()
    {
        if (!$this->isInitialized()) {
            $this->getOriginalNodeNames();
            $fetchDepth = $this->fetchDepth > 0 ? $this->fetchDepth + 1 : -1;
            $childNodes = $this->getNode($fetchDepth)->getNodes($this->filter);
            $this->collection = new ArrayCollection($this->getChildren($childNodes));
            $this->initialized = self::INITIALIZED_FROM_PHPCR;
        }
    }
464087
private function load()
    {
        $reflectionClass = new \ReflectionClass($this->name);
        $this->collectionInfo = new CollectionInfo();

        foreach ($this->reader->getClassAnnotations($reflectionClass) as $annotation) {
            $this->processClassAnnotation($annotation);
        }

        $properties = $reflectionClass->getProperties();

        foreach ($properties as $property) {
            foreach ($this->reader->getPropertyAnnotations($property) as $annotation) {
                if (!isset($this->propertiesInfos[$property->getName()])) {
                    $this->propertiesInfos[$property->getName()] = new PropertyInfo();
                }
                $this->processPropertiesAnnotation($property->getName(), $annotation);
            }
        }

        $this->eventManager = new EventManager();
        if ($this->hasEvent) {
            $methods = $reflectionClass->getMethods();
            foreach ($methods as $method) {
                $annotations = $this->reader->getMethodAnnotations($method);
                if (!empty($annotations)) {
                    foreach ($annotations as $annotation) {
                        if (in_array('JPC\MongoDB\ODM\Annotations\Event\Event', class_implements($annotation))) {
                            $this->eventManager->add($annotation, $method->getName());
                        }
                    }
                }
            }
        }

        $this->loaded = true;
    }
405165
public function init()
    {

        // initialize the prepared statements
        $this->stockItemStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::STOCK_ITEM));
    }
206051
function databaseInitialize() {
  var entries = db.getCollection("entries");
  var messages = db.getCollection("messages");

  // Add our main example collection if this is first run.
  // This collection will save into a partition named quickstart3.db.0 (collection 0)  
  if (entries === null) {
    // first time run so add and configure collection with some arbitrary options
    entries = db.addCollection("entries");
  }

  if (messages === null) {
    messages = db.addCollection("messages");
    messages.insert({ txt: "i will only insert into this collection during databaseInitialize" });
  }
}
1059374
protected void initCollection() {
        boolean collectionExists = MongoUtils.collectionExists(getDatabase(), getCollectionName());
        if (!collectionExists) {
            LOGGER.info("Creating collection [" + getCollectionName() + "]...");
            getDatabase().createCollection(getCollectionName());
            MongoCollection<?> collection = getCollection();

            LOGGER.info("Creating index for field [" + getCollectionName() + "."
                    + MongodbQueue.COLLECTION_FIELD_ID + "]...");
            collection.createIndex(new Document().append(MongodbQueue.COLLECTION_FIELD_ID, 1),
                    new IndexOptions().unique(true));

            LOGGER.info("Creating index for field [" + getCollectionName() + "."
                    + MongodbQueue.COLLECTION_FIELD_EPHEMERAL_KEY + "]...");
            collection.createIndex(
                    new Document().append(MongodbQueue.COLLECTION_FIELD_EPHEMERAL_KEY, 1),
                    new IndexOptions());

            LOGGER.info("Creating index for field [" + getCollectionName() + "."
                    + MongodbQueue.COLLECTION_FIELD_QUEUE_TIME + "]...");
            collection.createIndex(
                    new Document().append(MongodbQueue.COLLECTION_FIELD_QUEUE_TIME, 1),
                    new IndexOptions());

            LOGGER.info("Creating index for field [" + getCollectionName() + "."
                    + MongodbQueue.COLLECTION_FIELD_TIME + "]...");
            collection.createIndex(new Document().append(MongodbQueue.COLLECTION_FIELD_TIME, 1),
                    new IndexOptions());

        }
    }
10606
protected void initialize() {

        if (m_folderList != null) {
            // ensure folders are sorted starting with parent folders
            Collections.sort(m_folderList, I_CmsResource.COMPARE_ROOT_PATH);
        }

        if (m_fileList != null) {
            // ensure files are sorted starting with files in parent folders
            Collections.sort(m_fileList, I_CmsResource.COMPARE_ROOT_PATH);
        }

        if (m_deletedFolderList != null) {
            // ensure deleted folders are sorted starting with child folders
            Collections.sort(m_deletedFolderList, I_CmsResource.COMPARE_ROOT_PATH);
            Collections.reverse(m_deletedFolderList);
        }
    }
526276
def _load(db_data, db):
    
    if db.name != db_data["name"]:
        raise ValueError("dbname doesn't matches! Maybe wrong database data.")

    db.__init__(client=db._client, name=db.name)
    for col_name, col_data in iteritems(db_data["_collections"]):
        collection = db.get_collection(col_name)
        collection._documents = col_data["_documents"]
        collection._uniques = col_data["_uniques"]
        db._collections[col_name] = collection

    return db
1327745
public void init(final Collection<String> localSchemaNames, final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources,
                     final Map<String, RuleConfiguration> schemaRules, final boolean isUsingRegistry) {
        databaseType = JDBCDriverURLRecognizerEngine.getDatabaseType(schemaDataSources.values().iterator().next().values().iterator().next().getUrl());
        initSchemas(localSchemaNames, schemaDataSources, schemaRules, isUsingRegistry);
    }
932513
private void processDatabaseMappingCollection(final Object databaseMappingCollection) {
        if (databaseMappingCollection == null || !isCastable("java.util.Collection", databaseMappingCollection.getClass())) {
            return;
        }

        final Collection<?> c = (Collection<?>) databaseMappingCollection;
        for (Object descriptor : c) {
            processDatabaseMappingObject(descriptor);
        }
    }
646530
public void initializeDatabaseContent() {
        if (this.shogunInitEnabled) {
            LOG.info("Initializing SHOGun content");
            for (PersistentObject object : objectsToCreate) {
                if (object instanceof User) {
                    // special handling of users to encrypt the password!
                    initService.saveUser((User) object);
                } else {
                    initService.savePersistentObject(object);
                }
            }
        } else {
            LOG.info("Not initializing anything for SHOGun.");
        }
    }
866837
public function doFinalInitialization()
    {
        if (!$this->isInitialized) {
            foreach ($this->databases as $database) {
                $database->doFinalInitialization();
            }
            $this->isInitialized = true;
        }
    }
887082
protected function loadBaseSetIfNotLoaded()
    {
        if ($this->baseSetLoaded) {
            return;
        }

        $this->fillByArray($this->baseSet);
        $this->registerBaseAliases();

        $this->baseSetLoaded = true;
    }
1288275
public function initializeObject() {
		$databaseFilePath = $this->storageFolder . md5($this->getIndexName()) . '.db';
		$createDatabaseTables = FALSE;

		if (!is_file($databaseFilePath)) {
			if (!is_dir($this->storageFolder)) {
				mkdir($this->storageFolder, 0777, TRUE);
			}
			$createDatabaseTables = TRUE;
		}
		$this->connection = new \SQLite3($databaseFilePath);

		if ($createDatabaseTables) {
			$this->createIndexTables();
		} else {
			$this->loadAvailablePropertyFields();
		}
	}
492309
public function init()
    {

        // initialize the prepared statements
        $this->categoryIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_INTS));
        $this->categoryIntsByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_INTS_BY_PK_AND_STORE_ID));
    }
1350077
void init()
    {
        view.set(new View(
                         ImmutableList.of(new Memtable(cfstore)),
                         ImmutableList.<Memtable>of(),
                         Collections.<SSTableReader, SSTableReader>emptyMap(),
                         Collections.<SSTableReader>emptySet(),
                         Collections.<SSTableReader>emptySet(),
                         SSTableIntervalTree.empty()));
    }
113405
public function init()
    {

        // initialize the prepared statements
        $this->categoryTextsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_TEXTS));
        $this->categoryTextsByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_TEXTS_BY_PK_AND_STORE_ID));
    }
752825
public function loadCollection(PersistentCollectionInterface $collection) : void
    {
        if ($collection->getOwner() === null) {
            throw PersistentCollectionException::ownerRequiredToLoadCollection();
        }

        $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);
        $this->lifecycleEventManager->postCollectionLoad($collection);
    }