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

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

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

import win.doyto.query.entity.Persistable;

import java.io.Serializable;
import java.util.List;

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

    List query(Q query);

    long count(Q query);

    E get(I id);

    default E get(E e) {
        return get(e.getId());
    }

    int delete(I id);

    default int delete(E e) {
        return delete(e.getId());
    }

    int delete(Q query);

    void create(E e);

    void update(E e);

    void patch(E e);

    /**
     * force to get a new entity object from database
     *
     * @param id entity id
     * @return a new entity object
     */
    E fetch(I id);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy