public abstract class BaseRepository<T,ID extends Serializable> extends Object implements IGenericRepository<T,ID>
| Modifier and Type | Field and Description |
|---|---|
protected Class<? extends T> |
entityType |
static String |
JSON_QUERY |
protected Class<? extends ID> |
keyType |
protected static org.slf4j.Logger |
logger |
protected String |
requestPath |
| Constructor and Description |
|---|
BaseRepository(String requestPath) |
| Modifier and Type | Method and Description |
|---|---|
Integer |
delete(GenericWhere q) |
Integer |
delete(ID id) |
<S extends T> |
delete(S obj) |
PageableList<T> |
find(GenericQuery q) |
T |
find(ID id) |
<S extends T> |
find(S obj) |
<S extends T> |
find(S obj,
Pageable pager) |
PageableList<T> |
findAll(Pageable pager) |
static HashMap<String,FieldInfo> |
findEntityFieldInfo(Class<?> type) |
static HashMap<String,FieldInfo> |
findEntityKeyFieldInfo(Class<?> type) |
protected abstract <T> Object |
genericDBResourceLoad(HttpMethod method,
T requestObject) |
protected abstract <T> Object |
genericDBResourceLoad(String contentName,
HttpMethod method,
T requestObject) |
<S extends T> |
insert(List<S> obj) |
<S extends T> |
insert(S obj) |
static boolean |
isCustomClass(Object check) |
Integer |
save(GenericSet q) |
<S extends T> |
save(S obj) |
protected <R> PageableList<R> |
toList(Object genericDBResult,
Class<R> entityType) |
protected static final org.slf4j.Logger logger
public static final String JSON_QUERY
protected Class<? extends ID extends Serializable> keyType
protected String requestPath
public BaseRepository(String requestPath)
protected abstract <T> Object genericDBResourceLoad(String contentName, HttpMethod method, T requestObject) throws Exception
Exceptionprotected abstract <T> Object genericDBResourceLoad(HttpMethod method, T requestObject) throws Exception
Exceptionprotected <R> PageableList<R> toList(Object genericDBResult, Class<R> entityType) throws IOException
IOExceptionpublic static HashMap<String,FieldInfo> findEntityFieldInfo(Class<?> type) throws Exception
Exceptionpublic static HashMap<String,FieldInfo> findEntityKeyFieldInfo(Class<?> type) throws Exception
Exceptionpublic <S extends T> ID insert(S obj) throws Exception
insert in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic <S extends T> List<ID> insert(List<S> obj) throws Exception
insert in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic <S extends T> Integer save(S obj) throws Exception
save in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic Integer save(GenericSet q) throws IOException, URISyntaxException
save in interface IGenericRepository<T,ID extends Serializable>IOExceptionURISyntaxExceptionpublic Integer delete(ID id) throws Exception
delete in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic <S extends T> Integer delete(S obj) throws Exception
delete in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic Integer delete(GenericWhere q) throws Exception
delete in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic PageableList<T> findAll(Pageable pager) throws Exception
findAll in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic <S extends T> PageableList<T> find(S obj) throws Exception
find in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic T find(ID id) throws Exception
find in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic <S extends T> PageableList<T> find(S obj, Pageable pager) throws Exception
find in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic PageableList<T> find(GenericQuery q) throws Exception
find in interface IGenericRepository<T,ID extends Serializable>Exceptionpublic static boolean isCustomClass(Object check)
Copyright © 2016. All rights reserved.