package com.andrewkydev.database.orm; import java.util.List; import java.util.concurrent.CompletableFuture; public interface EntityManager { void insert(T entity); void update(T entity); void delete(T entity); T findById(Class type, Object id); List findAll(Class type); T findOneWhere(Class type, String where, List params); List findWhere(Class type, String where, List params); long count(Class type); long count(Class type, String where, List params); boolean exists(Class type, String where, List params); int deleteWhere(Class type, String where, List params); List findWhere( Class type, String where, List params, String orderBy, Integer limit, Integer offset ); CompletableFuture> findWhereAsync( Class type, String where, List params, String orderBy, Integer limit, Integer offset ); void registerAdapter(Class type, TypeAdapter adapter); EntityQuery query(Class type); CompletableFuture insertAsync(T entity); CompletableFuture updateAsync(T entity); CompletableFuture deleteAsync(T entity); CompletableFuture findByIdAsync(Class type, Object id); CompletableFuture> findAllAsync(Class type); CompletableFuture findOneWhereAsync(Class type, String where, List params); CompletableFuture> findWhereAsync(Class type, String where, List params); CompletableFuture countAsync(Class type); CompletableFuture countAsync(Class type, String where, List params); CompletableFuture existsAsync(Class type, String where, List params); CompletableFuture deleteWhereAsync(Class type, String where, List params); }