net.datacrow.core.wf
Class WorkFlow

java.lang.Object
  extended by net.datacrow.core.wf.WorkFlow

public class WorkFlow
extends java.lang.Object

Separation between the UI and the Data layer; allows the GUI to communicate with the DatabaseManager.

Author:
Robert Jan van der Waals

Method Summary
static boolean checkUniqueness(DcObject o, boolean isExisting)
          Checks the database to see if the item already exists.
 java.util.List<DcObject> convert(java.sql.ResultSet rs, int[] requestedFields)
          Converts the result set to a collection of items.
static void delete(DcObject o)
          Deletes the item from the database.
static WorkFlow getInstance()
           
static void handleRequests(Requests requests, boolean qryWasSuccess)
          Handles the requests.
static void insert(DcObject o)
          Saves the item to the database.
static void setValues(java.sql.ResultSet rs, DcObject item, int[] fields, int[] requestedFields)
           
static void update(DcObject o)
          Updates the item in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WorkFlow getInstance()

insert

public static void insert(DcObject o)
Saves the item to the database.

Parameters:
o -

update

public static void update(DcObject o)
Updates the item in the database.

Parameters:
o -

delete

public static void delete(DcObject o)
Deletes the item from the database.

Parameters:
o -

handleRequests

public static void handleRequests(Requests requests,
                                  boolean qryWasSuccess)
Handles the requests.

Parameters:
objects -
requests -
qryWasSuccess -

checkUniqueness

public static boolean checkUniqueness(DcObject o,
                                      boolean isExisting)
Checks the database to see if the item already exists.

Parameters:
o - The item to check.
isExisting - Indicates if the check is performed for a new or an existing item.

convert

public java.util.List<DcObject> convert(java.sql.ResultSet rs,
                                        int[] requestedFields)
Converts the result set to a collection of items.

Parameters:
rs - An unclosed SQL result set.
Returns:
Collection of items.

setValues

public static void setValues(java.sql.ResultSet rs,
                             DcObject item,
                             int[] fields,
                             int[] requestedFields)