public class AbstractDao<T,ID extends Serializable> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDao(Mapper<T,ID> mapper,
Supplier supplier) |
| Modifier and Type | Method and Description |
|---|---|
int |
count() |
int |
count(Object parentKey) |
void |
delete(ID id) |
void |
delete(Iterable<ID> ids) |
void |
delete(Object parentKey,
ID id) |
T |
get(ID id) |
T |
get(Object parentKey,
ID id) |
Future<T> |
getAsync(Object parentKey,
ID id) |
ID |
getId(Object key) |
Object |
getKey(ID id) |
Object |
getKey(Object parentKey,
ID id) |
String |
getKind() |
ID |
put(T entity) |
Future<ID> |
putAsync(T entity) |
protected Iterable<T> |
queryByField(Object ancestorKey,
String fieldName,
Object fieldValue) |
protected Iterable<T> |
queryIterable(boolean keysOnly,
int offset,
int limit,
Object ancestorKey,
String primaryOrderBy,
boolean primaryIsAscending,
String secondaryOrderBy,
boolean secondaryIsAscending,
Filter... filters) |
protected CursorPage<T> |
queryPage(boolean keysOnly,
int requestedPageSize,
Object ancestorKey,
String primaryOrderBy,
boolean primaryIsAscending,
String secondaryOrderBy,
boolean secondaryIsAscending,
Collection<String> projections,
String cursorString,
Filter... filters) |
CursorPage<T> |
queryPage(int requestedPageSize,
String cursorString) |
CursorPage<T> |
queryPage(Object ancestorKey,
int requestedPageSize,
String cursorString) |
protected T |
queryUniqueByField(Object parentKey,
String fieldName,
Object fieldValue) |
void |
setParentKey(T entity,
Object parentKey) |
static void |
setPrincipalName(String name) |
protected void |
updateAuditInfo(Object value,
String principalName,
Date date,
String createdByColumnName,
String createdDateColumnName,
String updatedByColumnName,
String updatedDateColumnName) |
<R> R |
withCommitTransaction(TransFunc<R> transFunc) |
<R> R |
withRollbackTransaction(TransFunc<R> transFunc) |
<R> R |
withTransaction(TransFunc<R> transFunc,
boolean commit) |
static <R> R |
withTransaction(TransFunc<R> transFunc,
boolean commit,
Supplier supplier) |
public <R> R withCommitTransaction(TransFunc<R> transFunc) throws IOException
IOExceptionpublic <R> R withRollbackTransaction(TransFunc<R> transFunc) throws IOException
IOExceptionpublic <R> R withTransaction(TransFunc<R> transFunc, boolean commit) throws IOException
IOExceptionpublic static <R> R withTransaction(TransFunc<R> transFunc, boolean commit, Supplier supplier) throws IOException
IOExceptionpublic int count()
public int count(Object parentKey)
public void delete(ID id) throws IOException
IOExceptionpublic void delete(Object parentKey, ID id) throws IOException
IOExceptionpublic void delete(Iterable<ID> ids) throws IOException
IOExceptionpublic T get(ID id) throws IOException
IOExceptionpublic T get(Object parentKey, ID id) throws IOException
IOExceptionpublic ID put(T entity) throws IOException
IOExceptionprotected Iterable<T> queryByField(Object ancestorKey, String fieldName, Object fieldValue)
protected T queryUniqueByField(Object parentKey, String fieldName, Object fieldValue)
public CursorPage<T> queryPage(int requestedPageSize, String cursorString)
public CursorPage<T> queryPage(Object ancestorKey, int requestedPageSize, String cursorString)
protected CursorPage<T> queryPage(boolean keysOnly, int requestedPageSize, Object ancestorKey, String primaryOrderBy, boolean primaryIsAscending, String secondaryOrderBy, boolean secondaryIsAscending, Collection<String> projections, String cursorString, Filter... filters)
protected Iterable<T> queryIterable(boolean keysOnly, int offset, int limit, Object ancestorKey, String primaryOrderBy, boolean primaryIsAscending, String secondaryOrderBy, boolean secondaryIsAscending, Filter... filters)
public Future<T> getAsync(Object parentKey, ID id) throws IOException
IOExceptionpublic Future<ID> putAsync(T entity) throws IOException
IOExceptionpublic String getKind()
public static void setPrincipalName(String name)
Copyright © 2014 Wadpam. All Rights Reserved.