|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a general Controller to use for all different data objects.
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).updateOnPk();
}
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 TODO provide reference to working example.
DataControl
Method Summary | |
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 |
java.lang.Object |
select(java.lang.Object o,
java.lang.Object condition)
select an Object of the type of the Object o which match the supplied
condition. |
java.util.Vector |
selectFromCondition(java.lang.Object o,
Condition condition)
select a collection of Objects of the type of the Object o which match the supplied
condition. |
java.util.Vector |
selectFromParent(java.lang.Object o,
java.lang.Object parent)
select a collection of Objects of the type of the Object o which match a defined
relation with the parent. |
int |
update(java.lang.Object o)
update an object of type o to the datastore |
Method Detail |
public int update(java.lang.Object o) throws java.lang.Exception
o
- Object, the object to update
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.updateOnPk()
public int insert(java.lang.Object o) throws java.lang.Exception
o
- Object, the object to insert
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.insert()
public int delete(java.lang.Object o) throws java.lang.Exception
o
- Object, the object to delete
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.updateOnPk()
public java.lang.Object select(java.lang.Object o, java.lang.Object condition) throws java.lang.Exception
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 objects
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.selectFromCondition(Condition)
,
Condition
public java.util.Vector selectFromParent(java.lang.Object o, java.lang.Object parent) throws java.lang.Exception
Object
o which match a defined
relation with the parent.
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.parent
- Object, this Object should contain the necessary information to make a relation
with this Object
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.selectOnParent(Object)
public java.util.Vector selectFromCondition(java.lang.Object o, Condition condition) throws java.lang.Exception
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 objects
Exception,
- exception thrown from the specific data store controls, such
as a JDBC driver
java.lang.Exception
DataControl.selectFromCondition(Condition)
,
Condition
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |