public class BaseDAO
extends java.lang.Object
Constructor and Description |
---|
BaseDAO() |
Modifier and Type | Method and Description |
---|---|
protected static <E> com.google.api.server.spi.response.CollectionResponse<E> |
buildCollectionResponse(com.google.cloud.datastore.QueryResults<E> iterator,
java.lang.Long time) |
protected static <E> void |
delete(java.lang.Class<E> varClass,
java.lang.Long id)
Delete entity by id
|
static <E> void |
delete(E var)
Delete entity
|
static <E> void |
deleteMany(java.util.List<E> list) |
static <E> void |
deleteManyNow(java.util.List<E> list) |
protected static com.googlecode.objectify.Objectify |
getOfy()
Get Objectify
|
protected static <E> java.util.List<E> |
list(java.lang.Class<E> varClass)
List of entities
|
protected static <S,E> java.util.Map<S,E> |
load(java.lang.Class<E> varClass,
java.util.List<S> ids) |
protected static <E> E |
load(java.lang.Class<E> varClass,
java.lang.Long id)
Load entity
|
protected static <E> E |
load(java.lang.Class<E> varClass,
java.lang.String id) |
protected static <E> com.googlecode.objectify.cmd.Query<E> |
queryDefault(java.lang.Class<E> varClass,
java.lang.Integer limit,
java.lang.String cursor) |
static <E> void |
save(E var)
Save entity
|
static <E> void |
saveMany(java.util.List<E> list) |
static <E> void |
saveManyNow(java.util.List<E> list) |
public static <E> void save(E var)
E
- Class of entityvar
- Entitypublic static <E> void saveMany(java.util.List<E> list)
public static <E> void saveManyNow(java.util.List<E> list)
protected static <E> E load(java.lang.Class<E> varClass, java.lang.Long id)
E
- Class of entityvarClass
- Class name to be loadid
- id of entityprotected static <S,E> java.util.Map<S,E> load(java.lang.Class<E> varClass, java.util.List<S> ids)
protected static <E> E load(java.lang.Class<E> varClass, java.lang.String id)
protected static <E> java.util.List<E> list(java.lang.Class<E> varClass)
E
- Class of entityvarClass
- Class name to be loadpublic static <E> void delete(E var)
E
- Class of entityvar
- Entitypublic static <E> void deleteMany(java.util.List<E> list)
public static <E> void deleteManyNow(java.util.List<E> list)
protected static <E> void delete(java.lang.Class<E> varClass, java.lang.Long id)
E
- Class of entityvarClass
- Class name of entityid
- id of entityprotected static com.googlecode.objectify.Objectify getOfy()
protected static <E> com.googlecode.objectify.cmd.Query<E> queryDefault(java.lang.Class<E> varClass, java.lang.Integer limit, java.lang.String cursor)
protected static <E> com.google.api.server.spi.response.CollectionResponse<E> buildCollectionResponse(com.google.cloud.datastore.QueryResults<E> iterator, java.lang.Long time)