rjw.dc.wf
Class WorkFlow

java.lang.Object
  |
  +--rjw.dc.wf.WorkFlow

public class WorkFlow
extends java.lang.Object

This is the layer between the UI and the database. Checks for data integrity and checks on bussiness rules are done here

Since:
1.3
Version:
DC0.50
Author:
Robert-Jan van der Waals

Constructor Summary
WorkFlow()
           
 
Method Summary
 boolean checkUniqueness(DataCrowObject o, boolean bUpdate)
          Checks if the object is unique
static java.util.Vector createDataCrowObjectArray(java.sql.ResultSet result)
          Converts a resultset to a DataCrowObject Vector
 void displayResults(java.sql.ResultSet result, RequestorCollection requestorObjects)
          Passes requests thru to the UI (MainFrame)
 void displayResults(java.util.Vector vTable, RequestorCollection requestorObjects)
          Passes requests thru to the UI (MainFrame)
static void initDatabase()
          Initializes the database
 void insertCollection(DataCrowCollection collection, RequestorCollection requestors)
           
 void insertValues(DataCrowObject o, RequestorCollection requestors)
          Inserts new values.
 void runQuery(java.lang.String sQuery, RequestorCollection requestors)
          Runs a predefined query
 java.lang.Object runQueryDirect(DataCrowObject o)
          Runs a query directly, bypassing the query queue
 java.lang.Object runQueryDirect(Query query)
          Does not put the query in a queue but executes it immediately.
 java.lang.Object runQueryDirect(java.lang.String sQuery)
          Does not put the query in a queue but executes it immediately.
 void searchValues(DataCrowObject o, QueryOptions queryOptions, RequestorCollection requestors)
          Searches for values.
 void updateCollection(DataCrowCollection collection, RequestorCollection requestors)
           
 void updateValues(DataCrowObject o, RequestorCollection requestors)
          Updates values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkFlow

public WorkFlow()
Method Detail

initDatabase

public static void initDatabase()
Initializes the database


updateCollection

public void updateCollection(DataCrowCollection collection,
                             RequestorCollection requestors)

insertCollection

public void insertCollection(DataCrowCollection collection,
                             RequestorCollection requestors)

runQuery

public void runQuery(java.lang.String sQuery,
                     RequestorCollection requestors)
Runs a predefined query

Parameters:
sQuery - query statement
requestors - requests to the UI

searchValues

public void searchValues(DataCrowObject o,
                         QueryOptions queryOptions,
                         RequestorCollection requestors)
Searches for values. The query is put in the query queue. The results are past to the caller by using the RequestorCollection

Parameters:
o - the object which is used as the condition
requestors - requestors for the result of the query (UI)

insertValues

public void insertValues(DataCrowObject o,
                         RequestorCollection requestors)
Inserts new values. The query is put in the query queue. Actions are past to the caller by using the RequestorCollection

Parameters:
o - the object to be inserted
requestors - requestors which depend on the outcome of the query

updateValues

public void updateValues(DataCrowObject o,
                         RequestorCollection requestors)
Updates values. The query is put in the query queue. Actions are past to the caller by using the RequestorCollection

Parameters:
o - the object to be updated
requestors - requestors which depend on the outcome of the query

runQueryDirect

public java.lang.Object runQueryDirect(DataCrowObject o)
Runs a query directly, bypassing the query queue

Parameters:
o - Data Crow object

runQueryDirect

public java.lang.Object runQueryDirect(Query query)
Does not put the query in a queue but executes it immediately. Errors are returned to the caller (not thrown)


runQueryDirect

public java.lang.Object runQueryDirect(java.lang.String sQuery)
Does not put the query in a queue but executes it immediately. Errors are returned to the caller (not thrown)

Parameters:
sQuery - query statement

displayResults

public void displayResults(java.util.Vector vTable,
                           RequestorCollection requestorObjects)
Passes requests thru to the UI (MainFrame)

Parameters:
vTable - data to be shown
requestorObjects - collection of requests

displayResults

public void displayResults(java.sql.ResultSet result,
                           RequestorCollection requestorObjects)
Passes requests thru to the UI (MainFrame)

Parameters:
result - the result of the query
requestorObjects - collection of requests

checkUniqueness

public boolean checkUniqueness(DataCrowObject o,
                               boolean bUpdate)
Checks if the object is unique

Parameters:
bUpdate - specifies if the object exists already in the database or not
Returns:
(boolean) uniqueness identifier

createDataCrowObjectArray

public static java.util.Vector createDataCrowObjectArray(java.sql.ResultSet result)
Converts a resultset to a DataCrowObject Vector

Parameters:
result - raw result from a query
Returns:
(Vector) vector of Data Crow