org.openanzo.server.repository.rdb.sql
Class InsertStatementsRdbWrapper

java.lang.Object
  extended by org.openanzo.server.repository.rdb.sql.InsertStatementsRdbWrapper

public class InsertStatementsRdbWrapper
extends java.lang.Object

InsertStatementsRdbWrapper provides wrappers around SQL queries and transforms ResultSets into java objects

Author:
Generated Source from org.openanzo.jdbc.utils.opgen.jet

Nested Class Summary
static class InsertStatementsRdbWrapper.BatchCreateIdTable
          Batch operation for adding parameters to the CreateIdTable prepared statement
static class InsertStatementsRdbWrapper.BatchDeleteTempStatements
          Batch operation for adding parameters to the DeleteTempStatements prepared statement
static class InsertStatementsRdbWrapper.BatchDropIdTable
          Batch operation for adding parameters to the DropIdTable prepared statement
static class InsertStatementsRdbWrapper.BatchInsertBatchRequestId
          Batch operation for adding parameters to the InsertBatchRequestId prepared statement
static class InsertStatementsRdbWrapper.BatchInsertTempStatement
          Batch operation for adding parameters to the InsertTempStatement prepared statement
static class InsertStatementsRdbWrapper.BatchSelectTempIdCount
          Batch operation for adding parameters to the SelectTempIdCount prepared statement
static interface InsertStatementsRdbWrapper.InsertTempStatementParams
          Interface for managing the parameters to the insertTempStatement prepared statement.
static class InsertStatementsRdbWrapper.InsertTempStatementParamsImpl
          Default implementation of InsertTempStatementParams
static interface InsertStatementsRdbWrapper.SelectInsertStatementsResult
          Interface for holding the results of the selectInsertStatements prepared statement.
static class InsertStatementsRdbWrapper.SelectInsertStatementsResultImpl
          Default implementation of SelectInsertStatementsResult
 
Field Summary
static java.lang.String commitInsertStatements
          Constant "commitInsertStatements" used to reference prepared statement InsertStatements.commitInsertStatements INSERT INTO STATEMENTS(NAMEDGRAPHID,SUBJ,PROP,OBJ,HSTART) SELECT ${a}STMTS_TMP.NAMEDGRAPHID, ${a}STMTS_TMP.SUBJ, ${a}STMTS_TMP.PROP, ${a}STMTS_TMP.OBJ, ${a}STMTS_TMP.MODIFIED FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1
static java.lang.String commitRemoveStatements
          Constant "commitRemoveStatements" used to reference prepared statement InsertStatements.commitRemoveStatements UPDATE STATEMENTS SET HEND=? WHERE ID IN( SELECT DISTINCT S.ID FROM ${a}STMTS_TMP ST,STATEMENTS S WHERE ST.OPERATION=0 AND ST.SUBJ=S.SUBJ AND ST.PROP=S.PROP AND ST.OBJ=S.OBJ AND ST.NAMEDGRAPHID=S.NAMEDGRAPHID AND S.HEND IS NULL)
static java.lang.String countInsertStatements
          Constant "countInsertStatements" used to reference prepared statement InsertStatements.countInsertStatements SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=1
static java.lang.String countRemoveStatements
          Constant "countRemoveStatements" used to reference prepared statement InsertStatements.countRemoveStatements SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=0
static java.lang.String createIdTable
          Constant "createIdTable" used to reference prepared statement InsertStatements.createIdTable DECLARE GLOBAL TEMPORARY TABLE IDS_TMP ( ID Long NOT NULL ) ON COMMIT DELETE ROWS NOT LOGGED ON ROLLBACK DELETE ROWS WITH REPLACE IN USR_TBSP;
static java.lang.String deleteTempStatements
          Constant "deleteTempStatements" used to reference prepared statement InsertStatements.deleteTempStatements DELETE FROM ${a}STMTS_TMP WHERE OPERATION IS NOT NULL
static java.lang.String dropIdTable
          Constant "dropIdTable" used to reference prepared statement InsertStatements.dropIdTable DROP TABLE ${a}IDS_TMP;
static java.lang.String getMax
          Constant "getMax" used to reference prepared statement InsertStatements.getMax SELECT MAX(ID) FROM STATEMENT
static java.lang.String getTempTablespaceDefined
          Constant "getTempTablespaceDefined" used to reference prepared statement InsertStatements.getTempTablespaceDefined SELECT COUNT(*) FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE='USR_TBSP'
static java.lang.String insertBatchRequestId
          Constant "insertBatchRequestId" used to reference prepared statement InsertStatements.insertBatchRequestId INSERT INTO ${a}IDS_TMP (ID) VALUES (?);
static java.lang.String insertTempStatement
          Constant "insertTempStatement" used to reference prepared statement InsertStatements.insertTempStatement INSERT INTO ${a}STMTS_TMP(OPERATION,NAMEDGRAPHID,SUBJ,PROP,OBJ,MODIFIED) VALUES(?,?,?,?,?,?)
static java.lang.String purgeInsertStatements
          Constant "purgeInsertStatements" used to reference prepared statement InsertStatements.purgeInsertStatements DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1 AND EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)
static java.lang.String purgeRemveStatements
          Constant "purgeRemveStatements" used to reference prepared statement InsertStatements.purgeRemveStatements DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=0 AND NOT EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)
static java.lang.String selectInsertStatements
          Constant "selectInsertStatements" used to reference prepared statement InsertStatements.selectInsertStatements SELECT ST.OPERATION, ST.NAMEDGRAPHID, ST.SUBJ, ST.PROP, ST.OBJ FROM ${a}STMTS_TMP ST
static java.lang.String selectTempIdCount
          Constant "selectTempIdCount" used to reference prepared statement InsertStatements.selectTempIdCount SELECT COUNT(*) FROM ${a}IDS_TMP
 
Constructor Summary
InsertStatementsRdbWrapper()
           
 
Method Summary
static int commitInsertStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the commitInsertStatements prepared statement.
static int commitRemoveStatements(PreparedStatementCache sqlCache, java.lang.Long hstart, java.lang.String sessionPrefix)
          Runs the commitRemoveStatements prepared statement.
static java.lang.Long countInsertStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the countInsertStatements prepared statement.
static java.lang.Long countRemoveStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the countRemoveStatements prepared statement.
static void createIdTable(PreparedStatementCache sqlCache)
          Runs the createIdTable prepared statement.
static void deleteTempStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the deleteTempStatements prepared statement.
static void dropIdTable(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the dropIdTable prepared statement.
static java.lang.Integer getMax(PreparedStatementCache sqlCache)
          Runs the getMax prepared statement.
static java.lang.Long getTempTablespaceDefined(PreparedStatementCache sqlCache)
          Runs the getTempTablespaceDefined prepared statement.
static void insertBatchRequestId(PreparedStatementCache sqlCache, long id, java.lang.String sessionPrefix)
          Runs the insertBatchRequestId prepared statement.
static void insertTempStatement(PreparedStatementCache sqlCache, InsertStatementsRdbWrapper.InsertTempStatementParams params, java.lang.String sessionPrefix)
          Runs the insertTempStatement prepared statement.
static void insertTempStatement(PreparedStatementCache sqlCache, int operation, long graphid, long subj, long prop, long obj, java.lang.Long modified, java.lang.String sessionPrefix)
          Runs the insertTempStatement prepared statement.
static void prepareCommitInsertStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the commitInsertStatements prepared statement.
static void prepareCommitRemoveStatements(java.sql.PreparedStatement ps, java.lang.Long hstart)
          Sets the input parameters for the commitRemoveStatements prepared statement.
static void prepareCountInsertStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the countInsertStatements prepared statement.
static void prepareCountRemoveStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the countRemoveStatements prepared statement.
static void prepareCreateIdTable(java.sql.PreparedStatement ps)
          Sets the input parameters for the createIdTable prepared statement.
static void prepareDeleteTempStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the deleteTempStatements prepared statement.
static void prepareDropIdTable(java.sql.PreparedStatement ps)
          Sets the input parameters for the dropIdTable prepared statement.
static void prepareGetMax(java.sql.PreparedStatement ps)
          Sets the input parameters for the getMax prepared statement.
static void prepareGetTempTablespaceDefined(java.sql.PreparedStatement ps)
          Sets the input parameters for the getTempTablespaceDefined prepared statement.
static void prepareInsertBatchRequestId(java.sql.PreparedStatement ps, long id)
          Sets the input parameters for the insertBatchRequestId prepared statement.
static void prepareInsertTempStatement(java.sql.PreparedStatement ps, int operation, long graphid, long subj, long prop, long obj, java.lang.Long modified)
          Sets the input parameters for the insertTempStatement prepared statement.
static void preparePurgeInsertStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the purgeInsertStatements prepared statement.
static void preparePurgeRemveStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the purgeRemveStatements prepared statement.
static void prepareSelectInsertStatements(java.sql.PreparedStatement ps)
          Sets the input parameters for the selectInsertStatements prepared statement.
static void prepareSelectTempIdCount(java.sql.PreparedStatement ps)
          Sets the input parameters for the selectTempIdCount prepared statement.
static int purgeInsertStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the purgeInsertStatements prepared statement.
static int purgeRemveStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the purgeRemveStatements prepared statement.
static ClosableIterator<InsertStatementsRdbWrapper.SelectInsertStatementsResult> selectInsertStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the selectInsertStatements prepared statement with the default transformer.
static ClosableIterator<InsertStatementsRdbWrapper.SelectInsertStatementsResult> selectInsertStatements(PreparedStatementCache sqlCache, java.lang.String sessionPrefix, Transformer<InsertStatementsRdbWrapper.SelectInsertStatementsResult> transform)
          Runs the selectInsertStatements prepared statement.
static void selectTempIdCount(PreparedStatementCache sqlCache, java.lang.String sessionPrefix)
          Runs the selectTempIdCount prepared statement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getTempTablespaceDefined

public static final java.lang.String getTempTablespaceDefined
Constant "getTempTablespaceDefined" used to reference prepared statement InsertStatements.getTempTablespaceDefined SELECT COUNT(*) FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE='USR_TBSP'

See Also:
Constant Field Values

insertTempStatement

public static final java.lang.String insertTempStatement
Constant "insertTempStatement" used to reference prepared statement InsertStatements.insertTempStatement INSERT INTO ${a}STMTS_TMP(OPERATION,NAMEDGRAPHID,SUBJ,PROP,OBJ,MODIFIED) VALUES(?,?,?,?,?,?)

See Also:
Constant Field Values

deleteTempStatements

public static final java.lang.String deleteTempStatements
Constant "deleteTempStatements" used to reference prepared statement InsertStatements.deleteTempStatements DELETE FROM ${a}STMTS_TMP WHERE OPERATION IS NOT NULL

See Also:
Constant Field Values

selectInsertStatements

public static final java.lang.String selectInsertStatements
Constant "selectInsertStatements" used to reference prepared statement InsertStatements.selectInsertStatements SELECT ST.OPERATION, ST.NAMEDGRAPHID, ST.SUBJ, ST.PROP, ST.OBJ FROM ${a}STMTS_TMP ST

See Also:
Constant Field Values

purgeInsertStatements

public static final java.lang.String purgeInsertStatements
Constant "purgeInsertStatements" used to reference prepared statement InsertStatements.purgeInsertStatements DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1 AND EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)

See Also:
Constant Field Values

purgeRemveStatements

public static final java.lang.String purgeRemveStatements
Constant "purgeRemveStatements" used to reference prepared statement InsertStatements.purgeRemveStatements DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=0 AND NOT EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)

See Also:
Constant Field Values

countInsertStatements

public static final java.lang.String countInsertStatements
Constant "countInsertStatements" used to reference prepared statement InsertStatements.countInsertStatements SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=1

See Also:
Constant Field Values

countRemoveStatements

public static final java.lang.String countRemoveStatements
Constant "countRemoveStatements" used to reference prepared statement InsertStatements.countRemoveStatements SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=0

See Also:
Constant Field Values

commitInsertStatements

public static final java.lang.String commitInsertStatements
Constant "commitInsertStatements" used to reference prepared statement InsertStatements.commitInsertStatements INSERT INTO STATEMENTS(NAMEDGRAPHID,SUBJ,PROP,OBJ,HSTART) SELECT ${a}STMTS_TMP.NAMEDGRAPHID, ${a}STMTS_TMP.SUBJ, ${a}STMTS_TMP.PROP, ${a}STMTS_TMP.OBJ, ${a}STMTS_TMP.MODIFIED FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1

See Also:
Constant Field Values

commitRemoveStatements

public static final java.lang.String commitRemoveStatements
Constant "commitRemoveStatements" used to reference prepared statement InsertStatements.commitRemoveStatements UPDATE STATEMENTS SET HEND=? WHERE ID IN( SELECT DISTINCT S.ID FROM ${a}STMTS_TMP ST,STATEMENTS S WHERE ST.OPERATION=0 AND ST.SUBJ=S.SUBJ AND ST.PROP=S.PROP AND ST.OBJ=S.OBJ AND ST.NAMEDGRAPHID=S.NAMEDGRAPHID AND S.HEND IS NULL)

See Also:
Constant Field Values

getMax

public static final java.lang.String getMax
Constant "getMax" used to reference prepared statement InsertStatements.getMax SELECT MAX(ID) FROM STATEMENT

See Also:
Constant Field Values

createIdTable

public static final java.lang.String createIdTable
Constant "createIdTable" used to reference prepared statement InsertStatements.createIdTable DECLARE GLOBAL TEMPORARY TABLE IDS_TMP ( ID Long NOT NULL ) ON COMMIT DELETE ROWS NOT LOGGED ON ROLLBACK DELETE ROWS WITH REPLACE IN USR_TBSP;

See Also:
Constant Field Values

dropIdTable

public static final java.lang.String dropIdTable
Constant "dropIdTable" used to reference prepared statement InsertStatements.dropIdTable DROP TABLE ${a}IDS_TMP;

See Also:
Constant Field Values

insertBatchRequestId

public static final java.lang.String insertBatchRequestId
Constant "insertBatchRequestId" used to reference prepared statement InsertStatements.insertBatchRequestId INSERT INTO ${a}IDS_TMP (ID) VALUES (?);

See Also:
Constant Field Values

selectTempIdCount

public static final java.lang.String selectTempIdCount
Constant "selectTempIdCount" used to reference prepared statement InsertStatements.selectTempIdCount SELECT COUNT(*) FROM ${a}IDS_TMP

See Also:
Constant Field Values
Constructor Detail

InsertStatementsRdbWrapper

public InsertStatementsRdbWrapper()
Method Detail

getTempTablespaceDefined

public static java.lang.Long getTempTablespaceDefined(PreparedStatementCache sqlCache)
                                               throws AnzoException,
                                                      java.sql.SQLException
Runs the getTempTablespaceDefined prepared statement. SELECT COUNT(*) FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE='USR_TBSP'

Parameters:
sqlCache - factory and cache of PreparedStatments
Returns:
Long
Throws:
AnzoException
java.sql.SQLException

prepareGetTempTablespaceDefined

public static void prepareGetTempTablespaceDefined(java.sql.PreparedStatement ps)
                                            throws java.sql.SQLException
Sets the input parameters for the getTempTablespaceDefined prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

insertTempStatement

public static void insertTempStatement(PreparedStatementCache sqlCache,
                                       InsertStatementsRdbWrapper.InsertTempStatementParams params,
                                       java.lang.String sessionPrefix)
                                throws AnzoException,
                                       java.sql.SQLException
Runs the insertTempStatement prepared statement. INSERT INTO ${a}STMTS_TMP(OPERATION,NAMEDGRAPHID,SUBJ,PROP,OBJ,MODIFIED) VALUES(?,?,?,?,?,?)

Parameters:
sqlCache - factory and cache of PreparedStatments
params - InsertTempStatementParams input Interface
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

insertTempStatement

public static void insertTempStatement(PreparedStatementCache sqlCache,
                                       int operation,
                                       long graphid,
                                       long subj,
                                       long prop,
                                       long obj,
                                       java.lang.Long modified,
                                       java.lang.String sessionPrefix)
                                throws AnzoException,
                                       java.sql.SQLException
Runs the insertTempStatement prepared statement. INSERT INTO ${a}STMTS_TMP(OPERATION,NAMEDGRAPHID,SUBJ,PROP,OBJ,MODIFIED) VALUES(?,?,?,?,?,?)

Parameters:
sqlCache - factory and cache of PreparedStatments
operation - template parameter
graphid - template parameter
subj - template parameter
prop - template parameter
obj - template parameter
modified - template parameter
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

prepareInsertTempStatement

public static void prepareInsertTempStatement(java.sql.PreparedStatement ps,
                                              int operation,
                                              long graphid,
                                              long subj,
                                              long prop,
                                              long obj,
                                              java.lang.Long modified)
                                       throws java.sql.SQLException
Sets the input parameters for the insertTempStatement prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
operation - template parameter
graphid - template parameter
subj - template parameter
prop - template parameter
obj - template parameter
modified - template parameter
Throws:
java.sql.SQLException

deleteTempStatements

public static void deleteTempStatements(PreparedStatementCache sqlCache,
                                        java.lang.String sessionPrefix)
                                 throws AnzoException,
                                        java.sql.SQLException
Runs the deleteTempStatements prepared statement. DELETE FROM ${a}STMTS_TMP WHERE OPERATION IS NOT NULL

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

prepareDeleteTempStatements

public static void prepareDeleteTempStatements(java.sql.PreparedStatement ps)
                                        throws java.sql.SQLException
Sets the input parameters for the deleteTempStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

selectInsertStatements

public static ClosableIterator<InsertStatementsRdbWrapper.SelectInsertStatementsResult> selectInsertStatements(PreparedStatementCache sqlCache,
                                                                                                               java.lang.String sessionPrefix)
                                                                                                        throws AnzoException,
                                                                                                               java.sql.SQLException
Runs the selectInsertStatements prepared statement with the default transformer. SELECT ST.OPERATION, ST.NAMEDGRAPHID, ST.SUBJ, ST.PROP, ST.OBJ FROM ${a}STMTS_TMP ST

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectInsertStatements

public static ClosableIterator<InsertStatementsRdbWrapper.SelectInsertStatementsResult> selectInsertStatements(PreparedStatementCache sqlCache,
                                                                                                               java.lang.String sessionPrefix,
                                                                                                               Transformer<InsertStatementsRdbWrapper.SelectInsertStatementsResult> transform)
                                                                                                        throws AnzoException,
                                                                                                               java.sql.SQLException
Runs the selectInsertStatements prepared statement. SELECT ST.OPERATION, ST.NAMEDGRAPHID, ST.SUBJ, ST.PROP, ST.OBJ FROM ${a}STMTS_TMP ST

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectInsertStatements

public static void prepareSelectInsertStatements(java.sql.PreparedStatement ps)
                                          throws java.sql.SQLException
Sets the input parameters for the selectInsertStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

purgeInsertStatements

public static int purgeInsertStatements(PreparedStatementCache sqlCache,
                                        java.lang.String sessionPrefix)
                                 throws AnzoException,
                                        java.sql.SQLException
Runs the purgeInsertStatements prepared statement. DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1 AND EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
int
Throws:
AnzoException
java.sql.SQLException

preparePurgeInsertStatements

public static void preparePurgeInsertStatements(java.sql.PreparedStatement ps)
                                         throws java.sql.SQLException
Sets the input parameters for the purgeInsertStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

purgeRemveStatements

public static int purgeRemveStatements(PreparedStatementCache sqlCache,
                                       java.lang.String sessionPrefix)
                                throws AnzoException,
                                       java.sql.SQLException
Runs the purgeRemveStatements prepared statement. DELETE FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=0 AND NOT EXISTS (SELECT S.NAMEDGRAPHID FROM STATEMENTS S WHERE S.NAMEDGRAPHID=${a}STMTS_TMP.NAMEDGRAPHID AND S.SUBJ=${a}STMTS_TMP.SUBJ AND S.PROP=${a}STMTS_TMP.PROP AND S.OBJ=${a}STMTS_TMP.OBJ AND S.HEND IS NULL)

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
int
Throws:
AnzoException
java.sql.SQLException

preparePurgeRemveStatements

public static void preparePurgeRemveStatements(java.sql.PreparedStatement ps)
                                        throws java.sql.SQLException
Sets the input parameters for the purgeRemveStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

countInsertStatements

public static java.lang.Long countInsertStatements(PreparedStatementCache sqlCache,
                                                   java.lang.String sessionPrefix)
                                            throws AnzoException,
                                                   java.sql.SQLException
Runs the countInsertStatements prepared statement. SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=1

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
Long
Throws:
AnzoException
java.sql.SQLException

prepareCountInsertStatements

public static void prepareCountInsertStatements(java.sql.PreparedStatement ps)
                                         throws java.sql.SQLException
Sets the input parameters for the countInsertStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

countRemoveStatements

public static java.lang.Long countRemoveStatements(PreparedStatementCache sqlCache,
                                                   java.lang.String sessionPrefix)
                                            throws AnzoException,
                                                   java.sql.SQLException
Runs the countRemoveStatements prepared statement. SELECT COUNT(*) FROM ${a}STMTS_TMP WHERE OPERATION=0

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
Long
Throws:
AnzoException
java.sql.SQLException

prepareCountRemoveStatements

public static void prepareCountRemoveStatements(java.sql.PreparedStatement ps)
                                         throws java.sql.SQLException
Sets the input parameters for the countRemoveStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

commitInsertStatements

public static int commitInsertStatements(PreparedStatementCache sqlCache,
                                         java.lang.String sessionPrefix)
                                  throws AnzoException,
                                         java.sql.SQLException
Runs the commitInsertStatements prepared statement. INSERT INTO STATEMENTS(NAMEDGRAPHID,SUBJ,PROP,OBJ,HSTART) SELECT ${a}STMTS_TMP.NAMEDGRAPHID, ${a}STMTS_TMP.SUBJ, ${a}STMTS_TMP.PROP, ${a}STMTS_TMP.OBJ, ${a}STMTS_TMP.MODIFIED FROM ${a}STMTS_TMP WHERE ${a}STMTS_TMP.OPERATION=1

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Returns:
int
Throws:
AnzoException
java.sql.SQLException

prepareCommitInsertStatements

public static void prepareCommitInsertStatements(java.sql.PreparedStatement ps)
                                          throws java.sql.SQLException
Sets the input parameters for the commitInsertStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

commitRemoveStatements

public static int commitRemoveStatements(PreparedStatementCache sqlCache,
                                         java.lang.Long hstart,
                                         java.lang.String sessionPrefix)
                                  throws AnzoException,
                                         java.sql.SQLException
Runs the commitRemoveStatements prepared statement. UPDATE STATEMENTS SET HEND=? WHERE ID IN( SELECT DISTINCT S.ID FROM ${a}STMTS_TMP ST,STATEMENTS S WHERE ST.OPERATION=0 AND ST.SUBJ=S.SUBJ AND ST.PROP=S.PROP AND ST.OBJ=S.OBJ AND ST.NAMEDGRAPHID=S.NAMEDGRAPHID AND S.HEND IS NULL)

Parameters:
sqlCache - factory and cache of PreparedStatments
hstart - template parameter
sessionPrefix - template parameter
Returns:
int
Throws:
AnzoException
java.sql.SQLException

prepareCommitRemoveStatements

public static void prepareCommitRemoveStatements(java.sql.PreparedStatement ps,
                                                 java.lang.Long hstart)
                                          throws java.sql.SQLException
Sets the input parameters for the commitRemoveStatements prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
hstart - template parameter
Throws:
java.sql.SQLException

getMax

public static java.lang.Integer getMax(PreparedStatementCache sqlCache)
                                throws AnzoException,
                                       java.sql.SQLException
Runs the getMax prepared statement. SELECT MAX(ID) FROM STATEMENT

Parameters:
sqlCache - factory and cache of PreparedStatments
Returns:
Integer
Throws:
AnzoException
java.sql.SQLException

prepareGetMax

public static void prepareGetMax(java.sql.PreparedStatement ps)
                          throws java.sql.SQLException
Sets the input parameters for the getMax prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

createIdTable

public static void createIdTable(PreparedStatementCache sqlCache)
                          throws AnzoException,
                                 java.sql.SQLException
Runs the createIdTable prepared statement. DECLARE GLOBAL TEMPORARY TABLE IDS_TMP ( ID Long NOT NULL ) ON COMMIT DELETE ROWS NOT LOGGED ON ROLLBACK DELETE ROWS WITH REPLACE IN USR_TBSP;

Parameters:
sqlCache - factory and cache of PreparedStatments
Throws:
AnzoException
java.sql.SQLException

prepareCreateIdTable

public static void prepareCreateIdTable(java.sql.PreparedStatement ps)
                                 throws java.sql.SQLException
Sets the input parameters for the createIdTable prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

dropIdTable

public static void dropIdTable(PreparedStatementCache sqlCache,
                               java.lang.String sessionPrefix)
                        throws AnzoException,
                               java.sql.SQLException
Runs the dropIdTable prepared statement. DROP TABLE ${a}IDS_TMP;

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

prepareDropIdTable

public static void prepareDropIdTable(java.sql.PreparedStatement ps)
                               throws java.sql.SQLException
Sets the input parameters for the dropIdTable prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException

insertBatchRequestId

public static void insertBatchRequestId(PreparedStatementCache sqlCache,
                                        long id,
                                        java.lang.String sessionPrefix)
                                 throws AnzoException,
                                        java.sql.SQLException
Runs the insertBatchRequestId prepared statement. INSERT INTO ${a}IDS_TMP (ID) VALUES (?);

Parameters:
sqlCache - factory and cache of PreparedStatments
id - template parameter
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

prepareInsertBatchRequestId

public static void prepareInsertBatchRequestId(java.sql.PreparedStatement ps,
                                               long id)
                                        throws java.sql.SQLException
Sets the input parameters for the insertBatchRequestId prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
id - template parameter
Throws:
java.sql.SQLException

selectTempIdCount

public static void selectTempIdCount(PreparedStatementCache sqlCache,
                                     java.lang.String sessionPrefix)
                              throws AnzoException,
                                     java.sql.SQLException
Runs the selectTempIdCount prepared statement. SELECT COUNT(*) FROM ${a}IDS_TMP

Parameters:
sqlCache - factory and cache of PreparedStatments
sessionPrefix - template parameter
Throws:
AnzoException
java.sql.SQLException

prepareSelectTempIdCount

public static void prepareSelectTempIdCount(java.sql.PreparedStatement ps)
                                     throws java.sql.SQLException
Sets the input parameters for the selectTempIdCount prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
Throws:
java.sql.SQLException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.