com.github.aidensuen.mongo.common.base.find.FindOneDao Maven / Gradle / Ivy
package com.github.aidensuen.mongo.common.base.find;
import com.github.aidensuen.mongo.annotation.RegisterMongoDao;
import com.github.aidensuen.mongo.annotation.FindProvider;
import com.github.aidensuen.mongo.command.OperationType;
import com.github.aidensuen.mongo.mapping.ExampleStr;
import com.github.aidensuen.mongo.provider.base.BaseFindProvider;
import org.springframework.data.mongodb.core.query.Query;
/**
* Generic Dao query interface
*
* @param Can not be null
* @author aidensuen
*/
@RegisterMongoDao
public interface FindOneDao {
/**
* There can only be one return value according to the attributes in the entity.
*
* @param record
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.FINDONE)
T findOne(T record);
/**
* There can only be one return value according to the query.
*
* @param query
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.FINDONE)
T findOne(Query query);
/**
* There can only be one return value according to the ExampleStr.
*
* @param o
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.FINDONE)
T findOne(ExampleStr o);
}