-
- All Known Implementing Classes:
MockDAO
public interface DAOThe core persistence interface. Stores and retrieves domain objects to/from a data store.- Author:
- Alex Bogdanovski [alex@erudika.com]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <P extends ParaObject>
Stringcreate(String appid, P object)Persists an object to the data store.<P extends ParaObject>
Stringcreate(P object)Persists an object to the data store.<P extends ParaObject>
voidcreateAll(String appid, List<P> objects)Saves multiple objects to the data store.<P extends ParaObject>
voidcreateAll(List<P> objects)Saves multiple objects to the data store.<P extends ParaObject>
voiddelete(String appid, P object)Deletes an object permanently.<P extends ParaObject>
voiddelete(P object)Deletes an object permanently.<P extends ParaObject>
voiddeleteAll(String appid, List<P> objects)Deletes multiple objects.<P extends ParaObject>
voiddeleteAll(List<P> objects)Deletes multiple objects.<P extends ParaObject>
Pread(String key)Retrieves an object from the data store.<P extends ParaObject>
Pread(String appid, String key)Retrieves an object from the data store.<P extends ParaObject>
Map<String,P>readAll(String appid, List<String> keys, boolean getAllColumns)Retrieves multiple objects from the data store.<P extends ParaObject>
Map<String,P>readAll(List<String> keys, boolean getAllColumns)Retrieves multiple objects from the data store.<P extends ParaObject>
List<P>readPage(Pager pager)Reads a fixed number of objects.<P extends ParaObject>
List<P>readPage(String appid, Pager pager)Reads a fixed number of objects.<P extends ParaObject>
voidupdate(String appid, P object)Updates an object permanently.<P extends ParaObject>
voidupdate(P object)Updates an object permanently.<P extends ParaObject>
voidupdateAll(String appid, List<P> objects)Updates multiple objects.<P extends ParaObject>
voidupdateAll(List<P> objects)Updates multiple objects.
-
-
-
Method Detail
-
create
<P extends ParaObject> String create(String appid, P object)
Persists an object to the data store.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobject- the domain object- Returns:
- the object's id or null if not created.
-
create
<P extends ParaObject> String create(P object)
Persists an object to the data store.- Type Parameters:
P- the type of object- Parameters:
object- the domain object- Returns:
- the object's id or null if not created.
-
read
<P extends ParaObject> P read(String appid, String key)
Retrieves an object from the data store.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppkey- an object id- Returns:
- the object or null if not found
-
read
<P extends ParaObject> P read(String key)
Retrieves an object from the data store.- Type Parameters:
P- the type of object- Parameters:
key- an object id- Returns:
- the object or null if not found
-
update
<P extends ParaObject> void update(String appid, P object)
Updates an object permanently.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobject- the domain object
-
update
<P extends ParaObject> void update(P object)
Updates an object permanently.- Type Parameters:
P- the type of object- Parameters:
object- the domain object
-
delete
<P extends ParaObject> void delete(String appid, P object)
Deletes an object permanently.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobject- the domain object
-
delete
<P extends ParaObject> void delete(P object)
Deletes an object permanently.- Type Parameters:
P- the type of object- Parameters:
object- the domain object
-
createAll
<P extends ParaObject> void createAll(String appid, List<P> objects)
Saves multiple objects to the data store.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobjects- the list of objects to save
-
createAll
<P extends ParaObject> void createAll(List<P> objects)
Saves multiple objects to the data store.- Type Parameters:
P- the type of object- Parameters:
objects- the list of objects to save
-
readAll
<P extends ParaObject> Map<String,P> readAll(String appid, List<String> keys, boolean getAllColumns)
Retrieves multiple objects from the data store.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppkeys- a list of object idsgetAllColumns- true if all columns must be retrieved. used to save bandwidth.- Returns:
- a map of ids to objects
-
readAll
<P extends ParaObject> Map<String,P> readAll(List<String> keys, boolean getAllColumns)
Retrieves multiple objects from the data store.- Type Parameters:
P- the type of object- Parameters:
keys- a list of object idsgetAllColumns- true if all columns must be retrieved. used to save bandwidth.- Returns:
- a map of ids to objects
-
readPage
<P extends ParaObject> List<P> readPage(String appid, Pager pager)
Reads a fixed number of objects. Used for scanning a data store page by page. Calling this method would bypass the read cache and will hit the DB.
-
readPage
<P extends ParaObject> List<P> readPage(Pager pager)
Reads a fixed number of objects. Used for scanning a data store page by page. Calling this method would bypass the read cache and will hit the DB.- Type Parameters:
P- the type of object- Parameters:
pager- aPager- Returns:
- a list of objects
-
updateAll
<P extends ParaObject> void updateAll(String appid, List<P> objects)
Updates multiple objects.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobjects- a list of objects to update
-
updateAll
<P extends ParaObject> void updateAll(List<P> objects)
Updates multiple objects.- Type Parameters:
P- the type of object- Parameters:
objects- a list of objects to update
-
deleteAll
<P extends ParaObject> void deleteAll(String appid, List<P> objects)
Deletes multiple objects.- Type Parameters:
P- the type of object- Parameters:
appid- name of theAppobjects- a list of objects to delete
-
deleteAll
<P extends ParaObject> void deleteAll(List<P> objects)
Deletes multiple objects.- Type Parameters:
P- the type of object- Parameters:
objects- a list of objects to delete
-
-