public interface EntityRepository<T, ID extends Serializable> { public boolean exists(ID id) ; public boolean exists(T entity) ; public T read(ID id) ; public T read(T entity) ; public T create(T entity) ; public T update(T entity) ; public T createOrUpdate(T entity) ; public void delete(T entity); public void delete(ID id); public long count(Object query); public List<T> findAll(); public List<T> findAll(Object query); public List<T> findAll(Object query, Sort sort); public Page<T> findAll(Object query, Pageable pageable); public void deleteAll(); public void deleteAll(Object query); }
T : Entity Object
ID : Entity Identity Object