|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.data.cursor.Cursor
public abstract class Cursor
Cursor is the Control class for a valid SQL select statement to be be used as a data class for which we can manipulate the data.
This includes inserting, deleting or selecting data, a bit like an Oracle Cursor.
Usage: Create a new Cursor object with a valid SQL connection and a String
containing a valid SQL statement. Cursor c=new Cursor({Valid Connection},"A distinquising name", "SELECT NAME, DEPARTMENT FROM EMP,DEP WHERE NAME.DEP_ID=DEPARTMENT.ID");
After this a Select statement will return a CursorData object. See the javadoc for this object for more information.
To get a new CursorData object use c.getNewCursorData()
Limitation: Updating and inserting will only proceed if the underlying database allows this particular operation for the particular query. Usually this only happens when all reference are explicit, all primary keys are set and all non-null values are filled. Cursor will pass the Exception thrown by the database through when there is a problem with mutating data.
CursorData
Field Summary | |
---|---|
protected CursorData |
m_prototype
|
Constructor Summary | |
---|---|
Cursor(java.lang.String name)
default constructor |
Method Summary | |
---|---|
abstract int |
delete(CursorData cd)
delete an object of type o from the datastore |
java.lang.String |
getName()
get the name for this cursor |
CursorData |
getNewCursorData()
Get an new CursorData object for this cursor, which has all the fields for this Cursor defined. |
protected CursorData |
getObject(CursorData prototype,
java.sql.ResultSet rs)
get a CursorData object filled from the current position in the ResultSet. |
abstract CursorData |
getProtoType()
get a prototype for this cursor, which is basically a defintion of the columns and types, but without the values |
abstract int |
insert(CursorData cd)
insert an object of type o to the datastore |
abstract CursorData |
retrieve(Condition condition)
select an Object of the type of the Object o which match the supplied
condition. |
abstract java.util.List |
retrieveList()
retrieve a list of Objects of the type of the Object |
abstract java.util.List |
retrieveList(Condition condition)
retrieve a list of Objects of the type of the Object o which match the supplied
condition. |
abstract int |
update(CursorData cd)
update an object of type o to the datastore |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CursorData m_prototype
Constructor Detail |
---|
public Cursor(java.lang.String name)
name
- String, a name for this cursorMethod Detail |
---|
public CursorData getNewCursorData()
public abstract CursorData getProtoType() throws DataException
CursorData
DataException
protected CursorData getObject(CursorData prototype, java.sql.ResultSet rs) throws java.sql.SQLException
prototype
- CursorData, object which functions as a prototype, will be
cloned to function as return type.rs
- ResultSet, a resultset with a valid position
SQLException,
- thrown if the resultset has no current position, or
if the database delivers an SQLException
java.sql.SQLException
public java.lang.String getName()
public abstract int update(CursorData cd) throws DataException
cd
- CursorData, the object to update
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
DataController.update(Object)
public abstract int insert(CursorData cd) throws DataException
cd
- CursorData, the object to insert
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
DataController.insert(Object)
public abstract int delete(CursorData cd) throws DataException
cd
- CursorData, the object to delete
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
DataController.delete(Object)
public abstract CursorData retrieve(Condition condition) throws DataException
Object
o which match the supplied
condition.
condition
- Condition the condition which should be met by the retrieved objects
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
DataController.retrieve(Object, Condition)
,
Condition
public abstract java.util.List retrieveList(Condition condition) throws DataException
Object
o which match the supplied
condition.
condition
- Condition the condition which should be met by the retrieved objects
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
DataController.retrieveList(Object, Condition)
,
Condition
public abstract java.util.List retrieveList() throws DataException
Object
DataException,
- exception thrown from the specific data store controls, such
as a JDBC driver are wrapped within this Exception
DataException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |