com.neko233.toolchain.common.crud.CrudApi Maven / Gradle / Ivy
package com.neko233.toolchain.common.crud;
import java.util.Collection;
import java.util.Collections;
/**
* 增删改查
* all API is OOP
*
* @author SolarisNeko on 2023-01-05
**/
public interface CrudApi {
/**
* add
*/
default boolean insert(T item) {
return insert(Collections.singleton(item));
}
boolean insert(Collection item);
/**
* delete
*/
default boolean delete(T item) {
return delete(Collections.singleton(item));
}
boolean delete(Collection item);
/**
* update
*/
default boolean update(T item) {
return update(Collections.singleton(item));
}
boolean update(Collection item);
/**
* get
*/
default boolean select(T item) {
return select(Collections.singleton(item));
}
boolean select(Collection item);
}