sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2460: Sqoop2: Refactor repository-common to use methods
Date Thu, 20 Aug 2015 03:56:44 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 668703cfe -> c1e4fbd5e


SQOOP-2460: Sqoop2: Refactor repository-common to use methods

(Colin Ma via Abraham Elmahrek)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/c1e4fbd5
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/c1e4fbd5
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/c1e4fbd5

Branch: refs/heads/sqoop2
Commit: c1e4fbd5e8801254fdef4497c30bd0f6927d5358
Parents: 668703c
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Aug 19 20:56:14 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Aug 19 20:56:14 2015 -0700

----------------------------------------------------------------------
 .../common/CommonRepositoryHandler.java         |  44 +++---
 ...RepositoryInsertUpdateDeleteSelectQuery.java | 152 ++++++++++---------
 .../derby/DerbyRepositoryHandler.java           |   6 +-
 3 files changed, 106 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/c1e4fbd5/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
index 1b5e2fb..c090d8e 100644
--- a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
+++ b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
@@ -17,6 +17,20 @@
  */
 package org.apache.sqoop.repository.common;
 
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.sqoop.common.Direction;
@@ -29,12 +43,10 @@ import org.apache.sqoop.common.SupportedDirections;
 import org.apache.sqoop.driver.Driver;
 import org.apache.sqoop.error.code.CommonRepositoryError;
 import org.apache.sqoop.model.InputEditable;
-import org.apache.sqoop.model.MConfigUpdateEntityType;
-import org.apache.sqoop.model.MLongInput;
-import org.apache.sqoop.model.SubmissionError;
 import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConfig;
 import org.apache.sqoop.model.MConfigType;
+import org.apache.sqoop.model.MConfigUpdateEntityType;
 import org.apache.sqoop.model.MConfigurableType;
 import org.apache.sqoop.model.MConnector;
 import org.apache.sqoop.model.MDriver;
@@ -47,10 +59,12 @@ import org.apache.sqoop.model.MIntegerInput;
 import org.apache.sqoop.model.MJob;
 import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.model.MLinkConfig;
+import org.apache.sqoop.model.MLongInput;
 import org.apache.sqoop.model.MMapInput;
 import org.apache.sqoop.model.MStringInput;
 import org.apache.sqoop.model.MSubmission;
 import org.apache.sqoop.model.MToConfig;
+import org.apache.sqoop.model.SubmissionError;
 import org.apache.sqoop.repository.JdbcRepositoryHandler;
 import org.apache.sqoop.repository.RepositoryError;
 import org.apache.sqoop.submission.SubmissionStatus;
@@ -58,20 +72,6 @@ import org.apache.sqoop.submission.counter.Counter;
 import org.apache.sqoop.submission.counter.CounterGroup;
 import org.apache.sqoop.submission.counter.Counters;
 
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Set of methods required from each JDBC based repository.
  */
@@ -197,7 +197,8 @@ public abstract class CommonRepositoryHandler extends JdbcRepositoryHandler
{
 
     try {
       updateConnectorStatement = conn.prepareStatement(crudQueries.getStmtUpdateConfigurable());
-      deleteInputRelation = conn.prepareStatement(CommonRepositoryInsertUpdateDeleteSelectQuery.STMT_DELETE_INPUT_RELATIONS_FOR_INPUT);
+      deleteInputRelation = conn.prepareStatement(crudQueries
+          .getStmtDeleteInputRelationsForInput());
       deleteInput = conn.prepareStatement(crudQueries.getStmtDeleteInputsForConfigurable());
       deleteConfigDirection = conn.prepareStatement(crudQueries.getStmtDeleteDirectionsForConfigurable());
       deleteConfig = conn.prepareStatement(crudQueries.getStmtDeleteConfigsForConfigurable());
@@ -244,7 +245,8 @@ public abstract class CommonRepositoryHandler extends JdbcRepositoryHandler
{
     PreparedStatement deleteInputRelation = null;
     try {
       updateDriverStatement = conn.prepareStatement(crudQueries.getStmtUpdateConfigurable());
-      deleteInputRelation = conn.prepareStatement(CommonRepositoryInsertUpdateDeleteSelectQuery.STMT_DELETE_INPUT_RELATIONS_FOR_INPUT);
+      deleteInputRelation = conn.prepareStatement(crudQueries
+          .getStmtDeleteInputRelationsForInput());
       deleteInput = conn.prepareStatement(crudQueries.getStmtDeleteInputsForConfigurable());
       deleteConfig = conn.prepareStatement(crudQueries.getStmtDeleteConfigsForConfigurable());
       updateDriverStatement.setString(1, mDriver.getUniqueName());
@@ -2045,8 +2047,8 @@ public abstract class CommonRepositoryHandler extends JdbcRepositoryHandler
{
   private void insertConfigInputRelationship(Long parent, Long child, Connection conn) {
     PreparedStatement baseInputRelationStmt = null;
     try {
-      baseInputRelationStmt = conn
-          .prepareStatement(CommonRepositoryInsertUpdateDeleteSelectQuery.STMT_INSERT_INTO_INPUT_RELATION);
+      baseInputRelationStmt = conn.prepareStatement(crudQueries
+          .getStmtInsertIntoInputRelation());
       baseInputRelationStmt.setLong(1, parent);
       baseInputRelationStmt.setLong(2, child);
       baseInputRelationStmt.executeUpdate();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/c1e4fbd5/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryInsertUpdateDeleteSelectQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryInsertUpdateDeleteSelectQuery.java
b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryInsertUpdateDeleteSelectQuery.java
index 28f5f6a..4f9e547 100644
--- a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryInsertUpdateDeleteSelectQuery.java
+++ b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryInsertUpdateDeleteSelectQuery.java
@@ -23,12 +23,12 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
   /**
    * ****DIRECTION TABLE *************
    */
-  public static final String STMT_SELECT_SQD_ID_BY_SQD_NAME =
+  private static final String STMT_SELECT_SQD_ID_BY_SQD_NAME =
       "SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQD_ID)
               + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME)
               + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQD_NAME) + "=?";
 
-  public static final String STMT_SELECT_SQD_NAME_BY_SQD_ID =
+  private static final String STMT_SELECT_SQD_NAME_BY_SQD_ID =
       "SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQD_NAME)
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQD_ID) + "=?";
@@ -37,7 +37,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * ******CONFIGURABLE TABLE **************
    */
   //DML: Get configurable by given name
-  public static final String STMT_SELECT_FROM_CONFIGURABLE =
+  private static final String STMT_SELECT_FROM_CONFIGURABLE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ", "
@@ -47,7 +47,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + " = ?";
 
   //DML: Get all configurables for a given type
-  public static final String STMT_SELECT_CONFIGURABLE_ALL_FOR_TYPE =
+  private static final String STMT_SELECT_CONFIGURABLE_ALL_FOR_TYPE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ", "
@@ -57,7 +57,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQC_TYPE) + " = ?";
 
   //DML: Insert into configurable
-  public static final String STMT_INSERT_INTO_CONFIGURABLE =
+  private static final String STMT_INSERT_INTO_CONFIGURABLE =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_CLASS) + ", "
@@ -66,12 +66,12 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + ") VALUES (?, ?, ?, ?)";
 
   //Delete all configs for a given configurable
-  public static final String STMT_DELETE_CONFIGS_FOR_CONFIGURABLE =
+  private static final String STMT_DELETE_CONFIGS_FOR_CONFIGURABLE =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + "
= ?";
 
   //Delete all inputs for a given configurable
-  public static final String STMT_DELETE_INPUTS_FOR_CONFIGURABLE =
+  private static final String STMT_DELETE_INPUTS_FOR_CONFIGURABLE =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME)
           + " WHERE "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG)
@@ -81,7 +81,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + " = ?)";
 
-  public static final String STMT_DELETE_INPUT_RELATIONS_FOR_INPUT =
+  private static final String STMT_DELETE_INPUT_RELATIONS_FOR_INPUT =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_RELATION_NAME)
           + " WHERE "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQIR_PARENT)
@@ -97,7 +97,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + " = ?))";
 
   //Update the configurable
-  public static final String STMT_UPDATE_CONFIGURABLE =
+  private static final String STMT_UPDATE_CONFIGURABLE =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
           + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + " = ?, "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQC_CLASS) + " = ?, "
@@ -109,7 +109,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******CONFIG TABLE *************
    */
   //DML: Get all configs for a given configurable
-  public static final String STMT_SELECT_CONFIG_FOR_CONFIGURABLE =
+  private static final String STMT_SELECT_CONFIG_FOR_CONFIGURABLE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + ", "
@@ -122,7 +122,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
 
 
   //DML: Insert into config
-  public static final String STMT_INSERT_INTO_CONFIG =
+  private static final String STMT_INSERT_INTO_CONFIG =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) +
" ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + ", "
@@ -134,7 +134,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * ******* INPUT TABLE *************
    */
   // DML: Get inputs for a given config
-  public static final String STMT_SELECT_INPUT =
+  private static final String STMT_SELECT_INPUT =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", "
@@ -151,7 +151,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " ORDER BY " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_INDEX);
 
    // DML get Input by Id
-  public static final String STMT_SELECT_INPUT_BY_ID =
+  private static final String STMT_SELECT_INPUT_BY_ID =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME)
@@ -159,7 +159,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + " = ?";
 
   // DML get Input by name
-  public static final String STMT_SELECT_INPUT_BY_NAME =
+  private static final String STMT_SELECT_INPUT_BY_NAME =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME)
@@ -167,7 +167,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + " = ?";
 
   // DML: Insert into config input
-  public static final String STMT_INSERT_INTO_INPUT =
+  private static final String STMT_INSERT_INTO_INPUT =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) +
" ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG) + ", "
@@ -180,13 +180,13 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
 
 /********** INPUT-RELATIONSHIP TABLE **************/
-  public static final String STMT_INSERT_INTO_INPUT_RELATION =
+  private static final String STMT_INSERT_INTO_INPUT_RELATION =
      "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_RELATION_NAME)
+ " ("
          + CommonRepoUtils.escapeColumnName(COLUMN_SQIR_PARENT) + ", "
          + CommonRepoUtils.escapeColumnName(COLUMN_SQIR_CHILD)
          + ") VALUES (?, ?)";
 
-  public static final String STMT_FETCH_SQ_INPUT_OVERRIDES =
+  private static final String STMT_FETCH_SQ_INPUT_OVERRIDES =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQIR_CHILD)
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_RELATION_NAME)
@@ -196,7 +196,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******LINK INPUT TABLE *************
    */
   //DML: Get inputs and values for a given link
-  public static final String STMT_FETCH_LINK_INPUT =
+  private static final String STMT_FETCH_LINK_INPUT =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", "
@@ -219,7 +219,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******JOB INPUT TABLE *************
    */
   //DML: Fetch inputs and values for a given job
-  public static final String STMT_FETCH_JOB_INPUT =
+  private static final String STMT_FETCH_JOB_INPUT =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", "
@@ -242,7 +242,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******LINK TABLE *************
    */
   // DML: Insert new link
-  public static final String STMT_INSERT_LINK =
+  private static final String STMT_INSERT_LINK =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "
("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE) + ", "
@@ -254,7 +254,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + ") VALUES (?, ?, ?, ?, ?, ?, ?)";
 
   // DML: Insert new link inputs
-  public static final String STMT_INSERT_LINK_INPUT =
+  private static final String STMT_INSERT_LINK_INPUT =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_INPUT) + ", "
@@ -262,7 +262,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + ") VALUES (?, ?, ?)";
 
   // DML: Update link
-  public static final String STMT_UPDATE_LINK =
+  private static final String STMT_UPDATE_LINK =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " SET
"
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + " = ?, "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_UPDATE_USER) + " = ?, "
@@ -270,31 +270,31 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ?";
 
   // DML: Enable or disable link
-  public static final String STMT_ENABLE_LINK =
+  private static final String STMT_ENABLE_LINK =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " SET
"
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ENABLED) + " = ? "
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ?";
 
 
   // UPDATE the LINK Input
-  public static final String STMT_UPDATE_LINK_INPUT =
+  private static final String STMT_UPDATE_LINK_INPUT =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) +
" SET "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_VALUE) + " = ? "
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_INPUT) + " = ?"
           + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + " = ?";
 
   // DML: Delete rows from link input table
-  public static final String STMT_DELETE_LINK_INPUT =
+  private static final String STMT_DELETE_LINK_INPUT =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + " = ?";
 
   // DML: Delete row from link table
-  public static final String STMT_DELETE_LINK =
+  private static final String STMT_DELETE_LINK =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ?";
 
   // DML: Select one specific link
-  public static final String STMT_SELECT_LINK_SINGLE =
+  private static final String STMT_SELECT_LINK_SINGLE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ", "
@@ -308,7 +308,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ?";
 
   // DML: Select one specific link by name
-  public static final String STMT_SELECT_LINK_SINGLE_BY_NAME =
+  private static final String STMT_SELECT_LINK_SINGLE_BY_NAME =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ", "
@@ -322,7 +322,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + " = ?";
 
   // DML: Select all links
-  public static final String STMT_SELECT_LINK_ALL =
+  private static final String STMT_SELECT_LINK_ALL =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ", "
@@ -335,7 +335,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME);
 
   // DML: Select all links for a specific connector.
-  public static final String STMT_SELECT_LINK_FOR_CONNECTOR_CONFIGURABLE =
+  private static final String STMT_SELECT_LINK_FOR_CONNECTOR_CONFIGURABLE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ", "
@@ -349,7 +349,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE) + "
= ?";
 
   // DML: Check if given link exists
-  public static final String STMT_SELECT_LINK_CHECK_BY_ID =
+  private static final String STMT_SELECT_LINK_CHECK_BY_ID =
       "SELECT count(*) FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ?";
 
@@ -357,7 +357,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******JOB TABLE *************
    */
   // DML: Insert new job
-  public static final String STMT_INSERT_JOB =
+  private static final String STMT_INSERT_JOB =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "
("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQB_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_LINK) + ", "
@@ -370,14 +370,14 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
 
   // DML: Insert new job inputs
-  public static final String STMT_INSERT_JOB_INPUT =
+  private static final String STMT_INSERT_JOB_INPUT =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_INPUT_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_JOB) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_VALUE)
           + ") VALUES (?, ?, ?)";
 
-  public static final String STMT_UPDATE_JOB =
+  private static final String STMT_UPDATE_JOB =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " SET "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQB_NAME) + " = ?, "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQB_UPDATE_USER) + " = ?, "
@@ -385,35 +385,35 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " = ?";
 
   // DML: Enable or disable job
-  public static final String STMT_ENABLE_JOB =
+  private static final String STMT_ENABLE_JOB =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " SET "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ENABLED) + " = ? "
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " = ?";
 
   // UPDATE the JOB Input
-  public static final String STMT_UPDATE_JOB_INPUT =
+  private static final String STMT_UPDATE_JOB_INPUT =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_INPUT_NAME) + "
SET "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_VALUE) + " = ? "
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + " = ?"
           + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_JOB) + " = ?";
 
   // DML: Delete rows from job input table
-  public static final String STMT_DELETE_JOB_INPUT =
+  private static final String STMT_DELETE_JOB_INPUT =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_INPUT_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_JOB) + " = ?";
 
   // DML: Delete row from job table
-  public static final String STMT_DELETE_JOB =
+  private static final String STMT_DELETE_JOB =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " = ?";
 
   // DML: Check if given job exists
-  public static final String STMT_SELECT_JOB_CHECK_BY_ID =
+  private static final String STMT_SELECT_JOB_CHECK_BY_ID =
       "SELECT count(*) FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " = ?";
 
   // DML: Check if there are jobs for given link
-  public static final String STMT_SELECT_JOBS_FOR_LINK_CHECK =
+  private static final String STMT_SELECT_JOBS_FOR_LINK_CHECK =
       "SELECT"
           + " count(*)"
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME)
@@ -422,7 +422,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " = ? ";
 
   //DML: Select all jobs
-  public static final String STMT_SELECT_JOB_ALL =
+  private static final String STMT_SELECT_JOB_ALL =
       "SELECT "
           + "FROM_CONNECTOR." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE)
+ ", "
           + "TO_CONNECTOR." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE)
+ ", "
@@ -442,22 +442,22 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " ON " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_LINK) + " = TO_CONNECTOR."
+ CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID);
 
   //DML: Select all jobs with order
-  public static final String STMT_SELECT_JOB_ALL_WITH_ORDER =
+  private static final String STMT_SELECT_JOB_ALL_WITH_ORDER =
       STMT_SELECT_JOB_ALL +
           " ORDER BY JOB." + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID);
 
   // DML: Select one specific job
-  public static final String STMT_SELECT_JOB_SINGLE_BY_ID =
+  private static final String STMT_SELECT_JOB_SINGLE_BY_ID =
       STMT_SELECT_JOB_ALL +
           " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " = ?";
 
   // DML: Select one specific job
-  public static final String STMT_SELECT_JOB_SINGLE_BY_NAME =
+  private static final String STMT_SELECT_JOB_SINGLE_BY_NAME =
       STMT_SELECT_JOB_ALL +
           " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_NAME) + " = ?";
 
   // DML: Select all jobs for a Connector
-  public static final String STMT_SELECT_ALL_JOBS_FOR_CONNECTOR_CONFIGURABLE =
+  private static final String STMT_SELECT_ALL_JOBS_FOR_CONNECTOR_CONFIGURABLE =
       STMT_SELECT_JOB_ALL +
           " WHERE FROM_CONNECTOR." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE)
+ " = ?" +
           " OR TO_CONNECTOR." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE)
+ " = ?";
@@ -466,7 +466,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
    * *******SUBMISSION TABLE *************
    */
   // DML: Insert new submission
-  public static final String STMT_INSERT_SUBMISSION =
+  private static final String STMT_INSERT_SUBMISSION =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME)
+ "("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_JOB) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_STATUS) + ", "
@@ -481,7 +481,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " VALUES(?, ?, ?, ?, ?, ?, ?, substr(?, 1, 150) , substr(?, 1, 150), substr(?,
1, 750))";
 
   // DML: Update existing submission
-  public static final String STMT_UPDATE_SUBMISSION =
+  private static final String STMT_UPDATE_SUBMISSION =
       "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) +
" SET "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_STATUS) + " = ?, "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_USER) + " = ?, "
@@ -491,19 +491,19 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + " = ?";
 
   // DML: Check if given submission exists
-  public static final String STMT_SELECT_SUBMISSION_CHECK =
+  private static final String STMT_SELECT_SUBMISSION_CHECK =
       "SELECT"
           + " count(*)"
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + " = ?";
 
   // DML: Purge old entries
-  public static final String STMT_PURGE_SUBMISSIONS =
+  private static final String STMT_PURGE_SUBMISSIONS =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_DATE) + " <
?";
 
   // DML: Get unfinished
-  public static final String STMT_SELECT_SUBMISSION_UNFINISHED =
+  private static final String STMT_SELECT_SUBMISSION_UNFINISHED =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_JOB) + ", "
@@ -520,7 +520,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_STATUS) + " = ?";
 
   // DML : Get all submissions
-  public static final String STMT_SELECT_SUBMISSIONS =
+  private static final String STMT_SELECT_SUBMISSIONS =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_JOB) + ", "
@@ -537,7 +537,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " ORDER BY " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_DATE) + " DESC";
 
   // DML: Get submissions for a job
-  public static final String STMT_SELECT_SUBMISSIONS_FOR_JOB =
+  private static final String STMT_SELECT_SUBMISSIONS_FOR_JOB =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQS_JOB) + ", "
@@ -555,7 +555,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " ORDER BY " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_DATE) + " DESC";
 
   // DML: Select context type
-  public static final String STMT_SELECT_CONTEXT_TYPE =
+  private static final String STMT_SELECT_CONTEXT_TYPE =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCT_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCT_NAME) + " "
@@ -563,13 +563,13 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQCT_NAME) + " = substr(?,
1, 25)";
 
   // DML: Insert new context type
-  public static final String STMT_INSERT_CONTEXT_TYPE =
+  private static final String STMT_INSERT_CONTEXT_TYPE =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONTEXT_TYPE)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCT_NAME) + ") "
           + "VALUES (substr(?, 1, 25))";
 
   // DML: Select context property
-  public static final String STMT_SELECT_CONTEXT_PROPERTY =
+  private static final String STMT_SELECT_CONTEXT_PROPERTY =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCP_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCP_NAME) + " "
@@ -577,13 +577,13 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQCP_NAME) + " = substr(?,
1, 500)";
 
   // DML: Insert new context property
-  public static final String STMT_INSERT_CONTEXT_PROPERTY =
+  private static final String STMT_INSERT_CONTEXT_PROPERTY =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONTEXT_PROPERTY)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCP_NAME) + ") "
           + "VALUES (substr(?, 1, 500))";
 
   // DML: Insert new context
-  public static final String STMT_INSERT_CONTEXT =
+  private static final String STMT_INSERT_CONTEXT =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONTEXT) + " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCO_SUBMISSION) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCO_TYPE) + ", "
@@ -592,7 +592,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "VALUES (?, ?, ?, substr(?, 1, 500))";
 
   // DML: Select context
-  public static final String STMT_SELECT_CONTEXT =
+  private static final String STMT_SELECT_CONTEXT =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCP_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCO_VALUE) + " "
@@ -603,7 +603,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQCO_TYPE) + " = ? ";
 
   // DML: Select counter group
-  public static final String STMT_SELECT_COUNTER_GROUP =
+  private static final String STMT_SELECT_COUNTER_GROUP =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQG_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQG_NAME) + " "
@@ -611,13 +611,13 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQG_NAME) + " = substr(?,
1, 75)";
 
   // DML: Insert new counter group
-  public static final String STMT_INSERT_COUNTER_GROUP =
+  private static final String STMT_INSERT_COUNTER_GROUP =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_GROUP_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQG_NAME) + ") "
           + "VALUES (substr(?, 1, 75))";
 
   // DML: Select counter
-  public static final String STMT_SELECT_COUNTER =
+  private static final String STMT_SELECT_COUNTER =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQR_ID) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQR_NAME) + " "
@@ -625,13 +625,13 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQR_NAME) + " = substr(?,
1, 75)";
 
   // DML: Insert new counter
-  public static final String STMT_INSERT_COUNTER =
+  private static final String STMT_INSERT_COUNTER =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQR_NAME) + ") "
           + "VALUES (substr(?, 1, 75))";
 
   // DML: Insert new counter submission
-  public static final String STMT_INSERT_COUNTER_SUBMISSION =
+  private static final String STMT_INSERT_COUNTER_SUBMISSION =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_SUBMISSION_NAME)
+ " ("
           + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_GROUP) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_COUNTER) + ", "
@@ -640,7 +640,7 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "VALUES (?, ?, ?, ?)";
 
   // DML: Select counter submission
-  public static final String STMT_SELECT_COUNTER_SUBMISSION =
+  private static final String STMT_SELECT_COUNTER_SUBMISSION =
       "SELECT "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQG_NAME) + ", "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQR_NAME) + ", "
@@ -653,41 +653,41 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
           + "WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_SUBMISSION) + " = ? ";
 
   // DML: Delete rows from counter submission table
-  public static final String STMT_DELETE_COUNTER_SUBMISSION =
+  private static final String STMT_DELETE_COUNTER_SUBMISSION =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_SUBMISSION_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_SUBMISSION) + " = ?";
 
   /**
    * **** CONFIG and CONNECTOR DIRECTIONS ***
    */
-  public static final String STMT_INSERT_SQ_CONNECTOR_DIRECTIONS =
+  private static final String STMT_INSERT_SQ_CONNECTOR_DIRECTIONS =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_DIRECTIONS_NAME)
+ " "
           + "(" + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_DIRECTION)
+ ")"
           + " VALUES (?, ?)";
 
-  public static final String STMT_INSERT_SQ_CONFIG_DIRECTIONS =
+  private static final String STMT_INSERT_SQ_CONFIG_DIRECTIONS =
       "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_DIRECTIONS_NAME)
+ " "
           + "(" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_CONFIG) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_DIRECTION)
+ ")"
           + " VALUES (?, ?)";
 
-  public static final String STMT_SELECT_SQ_CONNECTOR_DIRECTIONS_ALL =
+  private static final String STMT_SELECT_SQ_CONNECTOR_DIRECTIONS_ALL =
       "SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_DIRECTION)
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_DIRECTIONS_NAME);
 
-  public static final String STMT_SELECT_SQ_CONNECTOR_DIRECTIONS =
+  private static final String STMT_SELECT_SQ_CONNECTOR_DIRECTIONS =
       STMT_SELECT_SQ_CONNECTOR_DIRECTIONS_ALL + " WHERE "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR) + " = ?";
 
-  public static final String STMT_SELECT_SQ_CONFIG_DIRECTIONS_ALL =
+  private static final String STMT_SELECT_SQ_CONFIG_DIRECTIONS_ALL =
       "SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_CONFIG) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_DIRECTION)
           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_DIRECTIONS_NAME);
 
-  public static final String STMT_SELECT_SQ_CONFIG_DIRECTIONS =
+  private static final String STMT_SELECT_SQ_CONFIG_DIRECTIONS =
       STMT_SELECT_SQ_CONFIG_DIRECTIONS_ALL + " WHERE "
           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_CONFIG) + " = ?";
 
   // Delete the config directions for a connector
-  public static final String STMT_DELETE_DIRECTIONS_FOR_CONFIGURABLE =
+  private static final String STMT_DELETE_DIRECTIONS_FOR_CONFIGURABLE =
       "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_DIRECTIONS_NAME)
           + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_CONFIG)
           + " IN (SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + " FROM
" + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
@@ -968,4 +968,12 @@ public class CommonRepositoryInsertUpdateDeleteSelectQuery {
   public String getStmtDeleteDirectionsForConfigurable() {
     return STMT_DELETE_DIRECTIONS_FOR_CONFIGURABLE;
   }
+
+  public String getStmtDeleteInputRelationsForInput() {
+    return STMT_DELETE_INPUT_RELATIONS_FOR_INPUT;
+  }
+
+  public String getStmtInsertIntoInputRelation() {
+    return STMT_INSERT_INTO_INPUT_RELATION;
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/c1e4fbd5/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
index 2ba3384..2408558 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
@@ -577,7 +577,7 @@ public class DerbyRepositoryHandler extends CommonRepositoryHandler {
       String directionString = directions.remove(0);
       if (directionString != null && !directionString.isEmpty()) {
         Direction direction = Direction.valueOf(directionString);
-        runQuery(STMT_INSERT_SQ_CONFIG_DIRECTIONS, conn, configId, directionMap.get(direction));
+        runQuery(crudQueries.getStmtInsertSqConfigDirections(), conn, configId, directionMap.get(direction));
       }
     }
 
@@ -597,7 +597,7 @@ public class DerbyRepositoryHandler extends CommonRepositoryHandler {
 
     for (Long connectorId : connectorIds) {
       for (Long directionId : directionMap.values()) {
-        runQuery(STMT_INSERT_SQ_CONNECTOR_DIRECTIONS, conn, connectorId, directionId);
+        runQuery(crudQueries.getStmtInsertSqConnectorDirections(), conn, connectorId, directionId);
       }
     }
   }
@@ -737,7 +737,7 @@ public class DerbyRepositoryHandler extends CommonRepositoryHandler {
 
     PreparedStatement baseDriverStmt = null;
     try {
-      baseDriverStmt = conn.prepareStatement(STMT_INSERT_INTO_CONFIGURABLE,
+      baseDriverStmt = conn.prepareStatement(crudQueries.getStmtInsertIntoConfigurable(),
           Statement.RETURN_GENERATED_KEYS);
       baseDriverStmt.setString(1, MDriver.DRIVER_NAME);
       baseDriverStmt.setString(2, Driver.getClassName());


Mime
View raw message