Package org.hippoecm.frontend.model.ocm
Interface IStore<T>
-
- Type Parameters:
T
-
- All Superinterfaces:
org.apache.wicket.util.io.IClusterable
,Serializable
- All Known Subinterfaces:
ITypeStore
- All Known Implementing Classes:
BuiltinTypeStore
public interface IStore<T> extends org.apache.wicket.util.io.IClusterable
Store and retrieve objects. It uses a lifecycle for objects that requires them to be saved explicitly. The ids that are used must not be interpreted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete(T object)
Remove an object from storage.Iterator<T>
find(Map<String,Object> criteria)
Search for objects that meet the specified criteria.T
load(String id)
Load an object by its id.String
save(T object)
Store an object.
-
-
-
Method Detail
-
find
Iterator<T> find(Map<String,Object> criteria) throws StoreException
Search for objects that meet the specified criteria.- Parameters:
criteria
-- Returns:
- iterator over objects that meet the criteria
- Throws:
StoreException
-
load
T load(String id) throws StoreException
Load an object by its id. A StoreException is thrown if the object cannot be found.- Parameters:
id
-- Returns:
- object with the specified id
- Throws:
StoreException
-
save
String save(T object) throws StoreException
Store an object. The object need not be created by the store, it only needs to conform to the interface T. An id is generated for the object when one did not exist yet, otherwise the existing id is returned.- Parameters:
object
-- Returns:
- id of the object
- Throws:
StoreException
-
delete
void delete(T object) throws StoreException
Remove an object from storage.- Parameters:
object
-- Throws:
StoreException
-
-