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

com.arextest.schedule.dao.mongodb.ApplicationRepository Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package com.arextest.schedule.dao.mongodb;

import com.arextest.config.model.dao.config.AppCollection;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;

/**
 * @author wildeslam.
 * @create 2023/10/11 14:06
 */
@Slf4j
@Repository
public class ApplicationRepository implements RepositoryField {

  @Autowired
  MongoTemplate mongoTemplate;

  public AppCollection query(String appId) {
    Query query = Query.query(Criteria.where(AppCollection.Fields.appId).is(appId));
    return mongoTemplate.findOne(query, AppCollection.class, AppCollection.DOCUMENT_NAME);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy