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

com.github.aidensuen.mongo.common.base.insert.InsertDao Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
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 objectsToSave);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy