public interface DataController
Implementation of this class should be able to find the DataControl implementation for the type of Object which is provided as paramters through the methods
Implementations would look something like:
public int update(Object o) throws Exception {
return findDc(Object o).update();
}
public DataControl findDc(Object o) throws Exception {
//some method to find and instantiate the DataControl
}
This interface is defined in general terms because no assumptions should be made about the type of datastore so the DataControl must be as general as possible. The most simple implementation would be using a JDBC connection, but you could also use it for XML or flat file datastorage
DataControl| Modifier and Type | Method and Description |
|---|---|
int |
delete(java.lang.Object o)
delete an object of type o from the datastore
|
int |
insert(java.lang.Object o)
insert an object of type o to the datastore
|
<T> T |
retrieve(T o,
Condition condition)
retrieve an Object of the type of the
Object o which match the supplied
condition. |
<T> java.util.List<T> |
retrieveList(T o,
Condition condition)
retrieve a list of Objects of the type of the
Object o which match the supplied
condition. |
int |
update(java.lang.Object o)
update an object of type o to the datastore
|
int update(java.lang.Object o)
throws DataException
o - Object, the object to updateDataException - exception thrown if the specific data store controls throw an Exception,
such as a JDBC driver.DataControl.update()int insert(java.lang.Object o)
throws DataException
o - Object, the object to insertDataException - exception thrown if the specific data store controls throw an Exception,
such as a JDBC driver.DataControl.insert()int delete(java.lang.Object o)
throws DataException
o - Object, the object to deleteDataException - exception thrown if the specific data store controls throw an Exception,
such as a JDBC driver.DataControl.update()<T> T retrieve(T o,
Condition condition)
throws DataException
Object o which match the supplied
condition.o - Object the object which determines the type of objects you want to retrieve.
An implementantion should not assume anything about the content of this Object and most
implementations will ignore the values.condition - Condition the condition which should be met by the retrieved objectsDataException - exception thrown if the specific data store controls throw an Exception,
such as a JDBC driver.DataControl.retrieveList(Condition),
Condition<T> java.util.List<T> retrieveList(T o,
Condition condition)
throws DataException
Object o which match the supplied
condition.o - Object the object which determines the type of objects you want to retrieve.
An implementantion should not assume anything about the content of this Object and most
implementations will ignore the values.condition - Condition the condition which should be met by the retrieved objectsDataException - exception thrown if the specific data store controls throw an Exception,
such as a JDBC driver.DataControl.retrieveList(Condition),
Condition