org.syrup.sql
Class CreationFunctions

java.lang.Object
  extended byorg.syrup.sql.Functions
      extended byorg.syrup.sql.CreationFunctions

public class CreationFunctions
extends Functions

Utility functions to create Syrup Objects using JDBC.

Author:
Robbert van Dalen

Constructor Summary
CreationFunctions(SQLImpl sqlImpl)
          Constructor for the CreationFunctions object
 
Method Summary
 void createTables(SyrupConnection con)
          Creates an initial Workspace by executing SQL statements over a Connection.
protected  void newLink(Link l, java.util.Hashtable map, SyrupConnection con)
          Creates a new Link by executing SQL statements over a Connection.
protected  java.lang.String newTask(Task t, PTask parent, SyrupConnection con)
          Creates a new Task by executing SQL statements over a Connection.
 void reset(SyrupConnection con)
          Empties the Workspace by executing SQL statements over a Connection.
 
Methods inherited from class org.syrup.sql.Functions
sqlImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreationFunctions

public CreationFunctions(SQLImpl sqlImpl)
Constructor for the CreationFunctions object

Parameters:
sqlImpl - The SQLImpl that is held by the Function instance.
Method Detail

newTask

protected java.lang.String newTask(Task t,
                                   PTask parent,
                                   SyrupConnection con)
                            throws java.lang.Exception
Creates a new Task by executing SQL statements over a Connection. Returns the new Task identifier.

Parameters:
t - The new Task to be created.
parent - The PTask that is the parent of the Task to be created
con - The SyrupConnection over which SQL statements are executed.
Returns:
The new Task identifier.
Throws:
java.lang.Exception

newLink

protected void newLink(Link l,
                       java.util.Hashtable map,
                       SyrupConnection con)
                throws java.lang.Exception
Creates a new Link by executing SQL statements over a Connection.

Parameters:
l - The new Link to be created.
map - The Map that holds [Task -> Task-key].
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

reset

public void reset(SyrupConnection con)
           throws java.lang.Exception
Empties the Workspace by executing SQL statements over a Connection.

Parameters:
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception

createTables

public void createTables(SyrupConnection con)
                  throws java.lang.Exception
Creates an initial Workspace by executing SQL statements over a Connection.

Parameters:
con - The SyrupConnection over which SQL statements are executed.
Throws:
java.lang.Exception