first commit
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.andrewkydev.database.orm;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface EntityManager {
|
||||
|
||||
<T> void insert(T entity);
|
||||
|
||||
<T> void update(T entity);
|
||||
|
||||
<T> void delete(T entity);
|
||||
|
||||
<T> T findById(Class<T> type, Object id);
|
||||
|
||||
<T> List<T> findAll(Class<T> type);
|
||||
|
||||
<T> T findOneWhere(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> List<T> findWhere(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> long count(Class<T> type);
|
||||
|
||||
<T> long count(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> boolean exists(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> int deleteWhere(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> List<T> findWhere(
|
||||
Class<T> type,
|
||||
String where,
|
||||
List<Object> params,
|
||||
String orderBy,
|
||||
Integer limit,
|
||||
Integer offset
|
||||
);
|
||||
|
||||
<T> CompletableFuture<List<T>> findWhereAsync(
|
||||
Class<T> type,
|
||||
String where,
|
||||
List<Object> params,
|
||||
String orderBy,
|
||||
Integer limit,
|
||||
Integer offset
|
||||
);
|
||||
|
||||
<T> void registerAdapter(Class<T> type, TypeAdapter<T> adapter);
|
||||
|
||||
<T> EntityQuery<T> query(Class<T> type);
|
||||
|
||||
<T> CompletableFuture<Void> insertAsync(T entity);
|
||||
|
||||
<T> CompletableFuture<Void> updateAsync(T entity);
|
||||
|
||||
<T> CompletableFuture<Void> deleteAsync(T entity);
|
||||
|
||||
<T> CompletableFuture<T> findByIdAsync(Class<T> type, Object id);
|
||||
|
||||
<T> CompletableFuture<List<T>> findAllAsync(Class<T> type);
|
||||
|
||||
<T> CompletableFuture<T> findOneWhereAsync(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> CompletableFuture<List<T>> findWhereAsync(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> CompletableFuture<Long> countAsync(Class<T> type);
|
||||
|
||||
<T> CompletableFuture<Long> countAsync(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> CompletableFuture<Boolean> existsAsync(Class<T> type, String where, List<Object> params);
|
||||
|
||||
<T> CompletableFuture<Integer> deleteWhereAsync(Class<T> type, String where, List<Object> params);
|
||||
}
|
||||
Reference in New Issue
Block a user