|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JProjects.eab.data.DAManager
This abstract class defines the standard interface for a data access class. It provides access to a collection of rows from a table, and facilitates manipulation of rows by using a database cursor.
Field Summary | |
protected DataAccessObject |
_cachedObject
|
protected DAPropertySupport |
_changes
|
protected java.util.Vector |
_internalSequence
|
protected ManagerCompleteSupport |
_managerSupport
|
protected DAMap |
_map
|
protected java.sql.ResultSet |
_rs
|
protected java.sql.PreparedStatement |
_stmt
|
Constructor Summary | |
protected |
DAManager()
|
protected |
DAManager(DatastoreJDBC objD)
|
protected |
DAManager(int iCap,
int iIncr)
|
Method Summary | |
protected void |
_dbclose()
|
protected int |
_dbfill(java.util.Vector res,
int rowCnt)
|
void |
_executeAction(java.lang.String acnN,
java.lang.Object[] params)
|
protected void |
_fillInternalSequence()
|
void |
_handleException(java.lang.Exception ex)
|
protected DataAccessObject |
_newElement()
|
protected boolean |
_onBackground()
|
protected void |
_putOnBackgroundThread(java.lang.String acnN,
java.lang.Object[] params)
|
protected void |
_setAfterLastRow(boolean isAfterLast)
|
protected void |
_setBusy(boolean isBusy)
|
protected void |
_setFetched(boolean isFetched)
|
protected void |
_setOpen(boolean isOpen)
|
protected void |
_setStmtOptions()
|
void |
addManagerCompleteListener(ManagerCompleteListener l)
Use this method to register a listener for method complete events. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Use this method to register a listener for property changes. |
int |
append(int rowC)
Use this method to append the specified number of rows from the datastore to the current internal sequence that you have created by calling the fill method. |
int |
append(java.util.Vector v,
int rowC)
Use this method to append the specified number of rows from the datastore to the passed-in Vector object. |
void |
cancel()
This method cancels the SQL statement that is currently running. |
void |
close()
This method closes the cursor if one is open. |
void |
deleteFetched()
This method, when implemented in a subclass (such as <class> Manager, which is generated by Data Access Builder), deletes the row corresponding to the fetched object, if there is one. |
DataAccessObject |
elementAsDataAccessObject()
|
boolean |
fetchNext()
This method fetches the attributes from the next row into the cached object (a default object is provided). |
boolean |
fetchNextInto(DataAccessObject o)
This method fetches the attributes from the next row into a PersistentObject object. |
int |
fill(int rowC)
This method fetches the specified number of rows into the cached vector, starting at the row after the last-fetched row. |
int |
fill(java.util.Vector v,
int rowC)
This method fetches the specified number of rows into the passed-in Vector object, starting at the row after the last-fetched row. |
protected void |
firePropertyChange(java.lang.String prN,
java.lang.Object oldV,
java.lang.Object newV)
|
abstract DatastoreJDBC |
getCurrentDatastore()
This method is to be implemented in a subclass. |
int |
getMaxRows()
|
DatastoreJDBC |
getObjectsDatastore()
|
int |
getQueryTimeout()
|
boolean |
isAfterLastRow()
This method tells you whether last row was already fetched. |
boolean |
isAsynchronous()
|
boolean |
isBusy()
|
boolean |
isFetched()
This method tells you whether the current row has been fetched into the cached object. |
boolean |
isOpen()
This method tells you whether a cursor is open and usable. |
java.util.Vector |
items()
|
protected abstract DataAccessObject |
newElement()
|
abstract void |
open(java.lang.String whereSfx)
This abstract method can be implemented in a extending class, as it is in the classes generated by the Data Access Builder, to open a cursor for the rows specified in the passed-in SQL suffix. |
void |
prepareOpen(java.lang.String sqlSuffix,
java.lang.Object[] vals,
int[] types)
Use this method when You want prepare and execute parametrized statement. |
void |
removeManagerCompleteListener(ManagerCompleteListener l)
Use this method to remove the method complete listener on the manager object. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Use this method to remove the property change listener on the manager object. |
abstract void |
select(java.lang.String whereSfx)
This abstract method can be implemented in an extending class so that it opens a cursor, retrieves rows as specified in the passed-in SQL predicate into a collection, and closes the cursor. |
void |
setAsynchronous(boolean isAs)
This method lets you set whether the database methods are run on a background thread. |
void |
setMaxRows(int rc)
Use this method to set the maximum number of rows that a result set can contain. |
void |
setObjectsDatastore(DatastoreJDBC oDs)
This method sets the datastore associated with the current manager object to the DatastoreJDBC object passed in. |
void |
setQueryTimeout(int ti)
Use this method to set the maximum time (in seconds) that the database driver will wait for a query to be run. |
void |
updateFetched()
This method, when implemented in a subclass (such as <class> Manager, which is generated by Data Access Builder), updates the row corresponding to the fetched object, if there is one, with the cached object's attributes. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected transient java.sql.PreparedStatement _stmt
protected transient java.sql.ResultSet _rs
protected transient DAMap _map
protected transient DataAccessObject _cachedObject
protected transient java.util.Vector _internalSequence
protected transient DAPropertySupport _changes
protected transient ManagerCompleteSupport _managerSupport
Constructor Detail |
protected DAManager()
protected DAManager(int iCap, int iIncr)
protected DAManager(DatastoreJDBC objD)
Method Detail |
public void _executeAction(java.lang.String acnN, java.lang.Object[] params) throws java.lang.Exception
public void _handleException(java.lang.Exception ex)
public void addManagerCompleteListener(ManagerCompleteListener l)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public int append(int rowC) throws DAException
rowC
- - number of rows to retrieve from DB.public int append(java.util.Vector v, int rowC) throws DAException
v
- - vector for storing of retrieved rows.rowC
- - number of rows to retrieve from DB.public void cancel() throws DAException
public void close() throws DAException
public void deleteFetched() throws DAException
public void prepareOpen(java.lang.String sqlSuffix, java.lang.Object[] vals, int[] types) throws DAException
sqlSuffix
- - where clause of the statement.vals
- - array of values of the parameters. Length of the array must
correspond to the number of '?' placeholders in the statement.types
- - array of type codes for the parameters of the statement.
Length of the array must be equal to the vals
. Code values are
defined in the java.sql.Types
.Types
public DataAccessObject elementAsDataAccessObject()
public boolean fetchNext() throws DAException
public boolean fetchNextInto(DataAccessObject o) throws DAException
o
- - PersistentObject where to fetch current row.public int fill(int rowC) throws DAException
rowC
- - number of rows to fetch.public int fill(java.util.Vector v, int rowC) throws DAException
v
- - vector for storing fetched rows.rowC
- - number of rows to fetch.public abstract DatastoreJDBC getCurrentDatastore()
public DatastoreJDBC getObjectsDatastore()
public int getQueryTimeout()
public int getMaxRows()
public boolean isAsynchronous()
public boolean isBusy()
public boolean isFetched()
public boolean isOpen()
public boolean isAfterLastRow()
public java.util.Vector items()
public abstract void open(java.lang.String whereSfx) throws DAException
whereSfx
- - where clausepublic void removeManagerCompleteListener(ManagerCompleteListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public abstract void select(java.lang.String whereSfx) throws DAException
whereSfx
- - where clausepublic void setAsynchronous(boolean isAs)
public void setObjectsDatastore(DatastoreJDBC oDs)
public void setQueryTimeout(int ti)
public void setMaxRows(int rc)
public void updateFetched() throws DAException
protected void _dbclose() throws java.sql.SQLException
protected int _dbfill(java.util.Vector res, int rowCnt) throws java.sql.SQLException, DAException
protected void _fillInternalSequence() throws java.sql.SQLException, DAException
protected abstract DataAccessObject newElement()
protected DataAccessObject _newElement()
protected boolean _onBackground()
protected void _putOnBackgroundThread(java.lang.String acnN, java.lang.Object[] params)
protected void _setBusy(boolean isBusy)
protected void _setFetched(boolean isFetched)
protected void _setOpen(boolean isOpen)
protected void _setAfterLastRow(boolean isAfterLast)
protected void _setStmtOptions() throws java.sql.SQLException
protected void firePropertyChange(java.lang.String prN, java.lang.Object oldV, java.lang.Object newV)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |