com.github.aidensuen.mongo.common.base.insert.InsertDao Maven / Gradle / Ivy
package com.github.aidensuen.mongo.common.base.insert;
import com.github.aidensuen.mongo.annotation.InsertProvider;
import com.github.aidensuen.mongo.annotation.RegisterMongoDao;
import com.github.aidensuen.mongo.command.OperationType;
import com.github.aidensuen.mongo.provider.base.BaseInsertProvider;
import java.util.Collection;
/**
* Generic Dao insert interface
*
* @param Can not be null
* @author aidensuen
*/
@RegisterMongoDao
public interface InsertDao {
/**
* insert one record
*
* @param record
* @return
*/
@InsertProvider(type = BaseInsertProvider.class, operationType = OperationType.INSERT)
T insert(T record);
/**
* insert a list
*
* @param objectsToSave
* @return
*/
@InsertProvider(type = BaseInsertProvider.class, operationType = OperationType.INSERT)
Collection insertAll(Collection extends T> objectsToSave);
}