All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arextest.storage.repository.scenepool.AbstractScenePoolProvider Maven / Gradle / Ivy

There is a newer version: 1.3.4
Show newest version
package com.arextest.storage.repository.scenepool;

import com.arextest.model.scenepool.Scene;
import com.mongodb.client.MongoCollection;
import javax.annotation.Resource;
import org.springframework.data.mongodb.core.MongoTemplate;

public abstract class AbstractScenePoolProvider implements ScenePoolProvider {
  @Resource
  private MongoTemplate mongoTemplate;

  MongoTemplate getTemplate() {
    return mongoTemplate;
  }

  void setMongoDataBase(MongoTemplate mongoDatabase) {
    this.mongoTemplate = mongoDatabase;
  }

  MongoCollection getCollection() {
    String scenePoolName = this.getProviderName() + "ScenePool";
    return getTemplate().getMongoDatabaseFactory().getMongoDatabase().getCollection(scenePoolName, Scene.class);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy