test_class.declarator: TEST_CATALOG = "catalog"
test_class.modifier: private static final
test_class.original_string: private static final String TEST_CATALOG = "catalog";
test_class.type: String
test_class.var_name: TEST_CATALOG
test_class.declarator: TEST_TABLE = "table"
test_class.modifier: private static final
test_class.original_string: private static final String TEST_TABLE = "table";
test_class.type: String
test_class.var_name: TEST_TABLE
test_class.declarator: connection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Connection connection;
test_class.type: Connection
test_class.var_name: connection
test_class.declarator: databaseMetaData
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DatabaseMetaData databaseMetaData;
test_class.type: DatabaseMetaData
test_class.var_name: databaseMetaData
test_class.declarator: primaryResultSet
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet primaryResultSet;
test_class.type: ResultSet
test_class.var_name: primaryResultSet
test_class.declarator: columnResultSet
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet columnResultSet;
test_class.type: ResultSet
test_class.var_name: columnResultSet
test_class.declarator: statement
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Statement statement;
test_class.type: Statement
test_class.var_name: statement
test_class.declarator: caseSensitivesResultSet
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet caseSensitivesResultSet;
test_class.type: ResultSet
test_class.var_name: caseSensitivesResultSet
test_class.declarator: resultSetMetaData
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSetMetaData resultSetMetaData;
test_class.type: ResultSetMetaData
test_class.var_name: resultSetMetaData
test_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoaderTest.java
test_class.identifier: ColumnMetaDataLoaderTest
test_case.body: @Test
      public void assertLoad() throws SQLException {
          Collection<ColumnMetaData> actual = ColumnMetaDataLoader.load(connection, TEST_TABLE, "");
          assertThat(actual.size(), is(2));
          Iterator<ColumnMetaData> columnMetaDataIterator = actual.iterator();
          assertColumnMetaData(columnMetaDataIterator.next(), "pk_col", Types.INTEGER, "INT", true, true);
          assertColumnMetaData(columnMetaDataIterator.next(), "col", Types.VARCHAR, "VARCHAR", false, false);
      }
test_case.class_method_signature: ColumnMetaDataLoaderTest.assertLoad()
test_case.full_signature: @Test public void assertLoad()
test_case.identifier: assertLoad
test_case.invocations: load assertThat size is iterator assertColumnMetaData next assertColumnMetaData next
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertLoad()
focal_class.declarator: COLUMN_NAME = "COLUMN_NAME"
focal_class.modifier: private static final
focal_class.original_string: private static final String COLUMN_NAME = "COLUMN_NAME";
focal_class.type: String
focal_class.var_name: COLUMN_NAME
focal_class.declarator: DATA_TYPE = "DATA_TYPE"
focal_class.modifier: private static final
focal_class.original_string: private static final String DATA_TYPE = "DATA_TYPE";
focal_class.type: String
focal_class.var_name: DATA_TYPE
focal_class.declarator: TYPE_NAME = "TYPE_NAME"
focal_class.modifier: private static final
focal_class.original_string: private static final String TYPE_NAME = "TYPE_NAME";
focal_class.type: String
focal_class.var_name: TYPE_NAME
focal_class.declarator: TABLE_NAME = "TABLE_NAME"
focal_class.modifier: private static final
focal_class.original_string: private static final String TABLE_NAME = "TABLE_NAME";
focal_class.type: String
focal_class.var_name: TABLE_NAME
focal_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoader.java
focal_class.identifier: ColumnMetaDataLoader
focal_class.class_method_signature: ColumnMetaDataLoader.load(final Connection connection, final String tableNamePattern, final String databaseType)
focal_class.full_signature: public static Collection<ColumnMetaData> load(final Connection connection, final String tableNamePattern, final String databaseType)
focal_class.identifier: load
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection, final String tableNamePattern, final String databaseType)
focal_class.return: Collection<ColumnMetaData>
focal_class.signature: Collection<ColumnMetaData> load(final Connection connection, final String tableNamePattern, final String databaseType)
focal_class.class_method_signature: ColumnMetaDataLoader.generateEmptyResultSQL(final String table, final String databaseType)
focal_class.full_signature: private static String generateEmptyResultSQL(final String table, final String databaseType)
focal_class.identifier: generateEmptyResultSQL
focal_class.modifiers: private static
focal_class.parameters: (final String table, final String databaseType)
focal_class.return: String
focal_class.signature: String generateEmptyResultSQL(final String table, final String databaseType)
focal_class.class_method_signature: ColumnMetaDataLoader.loadPrimaryKeys(final Connection connection, final String table, final String databaseType)
focal_class.full_signature: private static Collection<String> loadPrimaryKeys(final Connection connection, final String table, final String databaseType)
focal_class.identifier: loadPrimaryKeys
focal_class.modifiers: private static
focal_class.parameters: (final Connection connection, final String table, final String databaseType)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> loadPrimaryKeys(final Connection connection, final String table, final String databaseType)
focal_method.body: public static Collection<ColumnMetaData> load(final Connection connection, final String tableNamePattern, final String databaseType) throws SQLException {
          Collection<ColumnMetaData> result = new LinkedList<>();
          Collection<String> primaryKeys = loadPrimaryKeys(connection, tableNamePattern, databaseType);
          List<String> columnNames = new ArrayList<>();
          List<Integer> columnTypes = new ArrayList<>();
          List<String> columnTypeNames = new ArrayList<>();
          List<Boolean> isPrimaryKeys = new ArrayList<>();
          List<Boolean> isCaseSensitives = new ArrayList<>();
          try (ResultSet resultSet = connection.getMetaData().getColumns(connection.getCatalog(), JdbcUtil.getSchema(connection, databaseType), tableNamePattern, "%")) {
              while (resultSet.next()) {
                  String tableName = resultSet.getString(TABLE_NAME);
                  if (Objects.equals(tableNamePattern, tableName)) {
                      String columnName = resultSet.getString(COLUMN_NAME);
                      columnTypes.add(resultSet.getInt(DATA_TYPE));
                      columnTypeNames.add(resultSet.getString(TYPE_NAME));
                      isPrimaryKeys.add(primaryKeys.contains(columnName));
                      columnNames.add(columnName);
                  }
              }
          }
          try (ResultSet resultSet = connection.createStatement().executeQuery(generateEmptyResultSQL(tableNamePattern, databaseType))) {
              for (String each : columnNames) {
                  isCaseSensitives.add(resultSet.getMetaData().isCaseSensitive(resultSet.findColumn(each)));
              }
          }
          for (int i = 0; i < columnNames.size(); i++) {
              // TODO load auto generated from database meta data
              result.add(new ColumnMetaData(columnNames.get(i), columnTypes.get(i), columnTypeNames.get(i), isPrimaryKeys.get(i), false, isCaseSensitives.get(i)));
          }
          return result;
      }
focal_method.class_method_signature: ColumnMetaDataLoader.load(final Connection connection, final String tableNamePattern, final String databaseType)
focal_method.full_signature: public static Collection<ColumnMetaData> load(final Connection connection, final String tableNamePattern, final String databaseType)
focal_method.identifier: load
focal_method.invocations: loadPrimaryKeys getColumns getMetaData getCatalog getSchema next getString equals getString add getInt add getString add contains add executeQuery createStatement generateEmptyResultSQL add isCaseSensitive getMetaData findColumn size add get get get get get
focal_method.modifiers: public static
focal_method.parameters: (final Connection connection, final String tableNamePattern, final String databaseType)
focal_method.return: Collection<ColumnMetaData>
focal_method.signature: Collection<ColumnMetaData> load(final Connection connection, final String tableNamePattern, final String databaseType)