jetbrains.buildServer.serverSide
Interface SQLRunner


public interface SQLRunner

Helper interface to perform sql operations.


Nested Class Summary
static interface SQLRunner.NoResultSQLAction
          Simple sql action without result.
static interface SQLRunner.SQLAction<T>
          Simple sql action with result.
 
Method Summary
 void commitCurrentTransaction()
          Commits current transaction
 long getNextId(java.lang.String tableName, java.lang.String idColumnName)
          Returns next id value to be used for insertion into the specified table.
 void runSql(SQLRunner.NoResultSQLAction action)
          Executes acton without result.
 void runSql(SQLRunner.NoResultSQLAction action, boolean ignoreError)
          Executes acton without result.
<T> T
runSql(SQLRunner.SQLAction<T> action)
          Executes sql action.
 

Method Detail

runSql

<T> T runSql(@NotNull
             SQLRunner.SQLAction<T> action)
Executes sql action.

Parameters:
action - action.
Returns:
action result.

runSql

void runSql(@NotNull
            SQLRunner.NoResultSQLAction action)
Executes acton without result.

Parameters:
action - action.

runSql

void runSql(@NotNull
            SQLRunner.NoResultSQLAction action,
            boolean ignoreError)
Executes acton without result.

Parameters:
action - action.
ignoreError - it the error should be ignored.

getNextId

long getNextId(@NotNull
               java.lang.String tableName,
               java.lang.String idColumnName)
Returns next id value to be used for insertion into the specified table.

Parameters:
tableName - table containing ids.
idColumnName - find next ID as max ID for this table
Returns:
next identifier.

commitCurrentTransaction

void commitCurrentTransaction()
Commits current transaction