com.github.aidensuen.mongo.common.base.find.ExistsDao 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 ExistsDao {
/**
* Return count according to the attributes in the entity.
*
* @param record
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.EXISTS)
boolean exists(T record);
/**
* Return count according to the query.
*
* @param query
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.EXISTS)
boolean exists(Query query);
/**
* Return count according to the ExampleStr.
*
* @param o
* @return
*/
@FindProvider(type = BaseFindProvider.class, operationType = OperationType.EXISTS)
boolean exists(ExampleStr o);
}