- All Known Implementing Classes:
MockDAO
public interface DAO
The core persistence interface. Stores and retrieves domain objects to/from a data store.
- Author:
- Alex Bogdanovski [[email protected]]
-
Method Summary
Modifier and TypeMethodDescription<P extends ParaObject>
StringPersists an object to the data store.<P extends ParaObject>
Stringcreate
(P object) Persists an object to the data store.<P extends ParaObject>
voidSaves multiple objects to the data store.<P extends ParaObject>
voidSaves multiple objects to the data store.<P extends ParaObject>
voidDeletes an object permanently.<P extends ParaObject>
voiddelete
(P object) Deletes an object permanently.<P extends ParaObject>
voidDeletes multiple objects.<P extends ParaObject>
voidDeletes multiple objects.<P extends ParaObject>
PRetrieves an object from the data store.<P extends ParaObject>
PRetrieves an object from the data store.<P extends ParaObject>
Map<String, P> Retrieves multiple objects from the data store.<P extends ParaObject>
Map<String, P> Retrieves multiple objects from the data store.<P extends ParaObject>
List<P> Reads a fixed number of objects.<P extends ParaObject>
List<P> Reads a fixed number of objects.<P extends ParaObject>
voidUpdates an object permanently.<P extends ParaObject>
voidupdate
(P object) Updates an object permanently.<P extends ParaObject>
voidUpdates multiple objects.<P extends ParaObject>
voidUpdates multiple objects.
-
Method Details
-
create
Persists an object to the data store.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
object
- the domain object- Returns:
- the object's id or null if not created.
-
create
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
Retrieves an object from the data store.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
key
- an object id- Returns:
- the object or null if not found
-
read
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
Updates an object permanently.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
object
- the domain object
-
update
Updates an object permanently.- Type Parameters:
P
- the type of object- Parameters:
object
- the domain object
-
delete
Deletes an object permanently.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
object
- the domain object
-
delete
Deletes an object permanently.- Type Parameters:
P
- the type of object- Parameters:
object
- the domain object
-
createAll
Saves multiple objects to the data store.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
objects
- the list of objects to save
-
createAll
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 theApp
keys
- a list of object idsgetAllColumns
- true if all columns must be retrieved. used to save bandwidth.- Returns:
- a map of ids to objects
-
readAll
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
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
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
Updates multiple objects.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
objects
- a list of objects to update
-
updateAll
Updates multiple objects.- Type Parameters:
P
- the type of object- Parameters:
objects
- a list of objects to update
-
deleteAll
Deletes multiple objects.- Type Parameters:
P
- the type of object- Parameters:
appid
- name of theApp
objects
- a list of objects to delete
-
deleteAll
Deletes multiple objects.- Type Parameters:
P
- the type of object- Parameters:
objects
- a list of objects to delete
-