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

win.doyto.query.core.CrudService Maven / Gradle / Ivy

There is a newer version: 0.2.2.1-RELEASE
Show newest version
package win.doyto.query.core;

import org.springframework.transaction.annotation.Transactional;
import win.doyto.query.entity.Persistable;

import java.io.Serializable;

/**
 * CrudService
 *
 * @author f0rb
 */
public interface CrudService, I extends Serializable, Q> extends QueryService {

    E get(I id);

    void create(E e);

    void update(E e);

    void patch(E e);

    @Transactional
    default void batchInsert(Iterable entities) {
        if (entities != null) {
            for (E entity : entities) {
                this.create(entity);
            }
        }
    }

    E delete(I id);

    int delete(Q query);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy