package org.academiadecodigo.bootcamp.fxlogin.persistence.dao;

import org.academiadecodigo.bootcamp.fxlogin.model.AbstractModel;
import org.academiadecodigo.bootcamp.fxlogin.persistence.TransactionException;

import java.util.List;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public interface Dao<T extends AbstractModel> {
    void saveOrUpdate(T entity) throws TransactionException;
    List<T> findAll();
    List<T> findAll(String prop, Object value);
    T findById(Integer id);
    T find(String prop, Object value);
    Long count();
    void deleteById(Integer id);
}
