package me.chyxion.tigon.service;

import java.util.List;
import me.chyxion.tigon.mybatis.Search;
import javax.validation.constraints.NotNull;
import org.springframework.validation.annotation.Validated;
import me.chyxion.tigon.validation.annotation.NotNullOrBlank;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Nov 7, 2016 4:20:42 PM
 */
@Validated
public interface BaseDeleteService<PrimaryKey, Model> {

    /**
     * delete by search
     * @param search search
     * @return models deleted
     */
    List<Model> delete(@NotNull Search search);
    
    /**
     * delete by primaryKey
     * @param primaryKey primaryKey
     * @return model deleted
     */
    Model delete(@NotNullOrBlank PrimaryKey primaryKey);
}
