test_class.declarator: NAME = "features"
test_class.modifier: private static final
test_class.original_string: private static final String NAME = "features";
test_class.type: String
test_class.var_name: NAME
test_class.declarator: TABLE_NAME = "cqtbl_" + NAME
test_class.modifier: private static final
test_class.original_string: private static final String TABLE_NAME = "cqtbl_" + NAME;
test_class.type: String
test_class.var_name: TABLE_NAME
test_class.declarator: INDEX_NAME = "cqidx_" + NAME + "_value"
test_class.modifier: private static final
test_class.original_string: private static final String INDEX_NAME = "cqidx_" + NAME + "_value";
test_class.type: String
test_class.var_name: INDEX_NAME
test_class.declarator: temporaryFileDatabase = new TemporaryFileDatabase()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFileDatabase temporaryFileDatabase = new TemporaryFileDatabase();
test_class.type: TemporaryFileDatabase
test_class.var_name: temporaryFileDatabase
test_class.file: code/src/test/java/com/googlecode/cqengine/index/sqlite/support/DBQueriesTest.java
test_class.identifier: DBQueriesTest
test_case.body: @Test
      public void testCreateIndexTable() throws SQLException {
  
          Connection connection = null;
          Statement statement = null;
          try {
              ConnectionManager connectionManager = temporaryFileDatabase.getConnectionManager(true);
              connection = spy(connectionManager.getConnection(null, noQueryOptions()));
              statement = spy(connection.createStatement());
              when(connection.createStatement()).thenReturn(statement);
  
              DBQueries.createIndexTable(NAME, Integer.class, String.class, connection);
  
              assertObjectExistenceInSQLIteMasterTable(TABLE_NAME, "table", true, connectionManager);
              assertObjectExistenceInSQLIteMasterTable(INDEX_NAME, "index", false, connectionManager);
              verify(statement, times(1)).close();
          }finally {
              DBUtils.closeQuietly(connection);
              DBUtils.closeQuietly(statement);
          }
      }
test_case.class_method_signature: DBQueriesTest.testCreateIndexTable()
test_case.full_signature: @Test public void testCreateIndexTable()
test_case.identifier: testCreateIndexTable
test_case.invocations: getConnectionManager spy getConnection noQueryOptions spy createStatement thenReturn when createStatement createIndexTable assertObjectExistenceInSQLIteMasterTable assertObjectExistenceInSQLIteMasterTable close verify times closeQuietly closeQuietly
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateIndexTable()
focal_class.file: code/src/main/java/com/googlecode/cqengine/index/sqlite/support/DBQueries.java
focal_class.identifier: DBQueries
focal_class.class_method_signature: DBQueries.createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_class.full_signature: public static void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_class.identifier: createIndexTable
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_class.return: void
focal_class.signature: void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_class.class_method_signature: DBQueries.indexTableExists(final String tableName, final Connection connection)
focal_class.full_signature: public static boolean indexTableExists(final String tableName, final Connection connection)
focal_class.identifier: indexTableExists
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: boolean
focal_class.signature: boolean indexTableExists(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.createIndexOnTable(final String tableName, final Connection connection)
focal_class.full_signature: public static void createIndexOnTable(final String tableName, final Connection connection)
focal_class.identifier: createIndexOnTable
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: void
focal_class.signature: void createIndexOnTable(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.suspendSyncAndJournaling(final Connection connection)
focal_class.full_signature: public static void suspendSyncAndJournaling(final Connection connection)
focal_class.identifier: suspendSyncAndJournaling
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: void
focal_class.signature: void suspendSyncAndJournaling(final Connection connection)
focal_class.class_method_signature: DBQueries.setSyncAndJournaling(final Connection connection, final SQLiteConfig.SynchronousMode pragmaSynchronous, final SQLiteConfig.JournalMode pragmaJournalMode)
focal_class.full_signature: public static void setSyncAndJournaling(final Connection connection, final SQLiteConfig.SynchronousMode pragmaSynchronous, final SQLiteConfig.JournalMode pragmaJournalMode)
focal_class.identifier: setSyncAndJournaling
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection, final SQLiteConfig.SynchronousMode pragmaSynchronous, final SQLiteConfig.JournalMode pragmaJournalMode)
focal_class.return: void
focal_class.signature: void setSyncAndJournaling(final Connection connection, final SQLiteConfig.SynchronousMode pragmaSynchronous, final SQLiteConfig.JournalMode pragmaJournalMode)
focal_class.class_method_signature: DBQueries.getPragmaSynchronousOrNull(final Connection connection)
focal_class.full_signature: public static SQLiteConfig.SynchronousMode getPragmaSynchronousOrNull(final Connection connection)
focal_class.identifier: getPragmaSynchronousOrNull
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: SQLiteConfig.SynchronousMode
focal_class.signature: SQLiteConfig.SynchronousMode getPragmaSynchronousOrNull(final Connection connection)
focal_class.class_method_signature: DBQueries.getPragmaJournalModeOrNull(final Connection connection)
focal_class.full_signature: public static SQLiteConfig.JournalMode getPragmaJournalModeOrNull(final Connection connection)
focal_class.identifier: getPragmaJournalModeOrNull
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: SQLiteConfig.JournalMode
focal_class.signature: SQLiteConfig.JournalMode getPragmaJournalModeOrNull(final Connection connection)
focal_class.class_method_signature: DBQueries.dropIndexOnTable(final String tableName, final Connection connection)
focal_class.full_signature: public static void dropIndexOnTable(final String tableName, final Connection connection)
focal_class.identifier: dropIndexOnTable
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: void
focal_class.signature: void dropIndexOnTable(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.dropIndexTable(final String tableName, final Connection connection)
focal_class.full_signature: public static void dropIndexTable(final String tableName, final Connection connection)
focal_class.identifier: dropIndexTable
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: void
focal_class.signature: void dropIndexTable(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.clearIndexTable(final String tableName, final Connection connection)
focal_class.full_signature: public static void clearIndexTable(final String tableName, final Connection connection)
focal_class.identifier: clearIndexTable
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: void
focal_class.signature: void clearIndexTable(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.compactDatabase(final Connection connection)
focal_class.full_signature: public static void compactDatabase(final Connection connection)
focal_class.identifier: compactDatabase
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: void
focal_class.signature: void compactDatabase(final Connection connection)
focal_class.class_method_signature: DBQueries.expandDatabase(final Connection connection, long numBytes)
focal_class.full_signature: public static void expandDatabase(final Connection connection, long numBytes)
focal_class.identifier: expandDatabase
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection, long numBytes)
focal_class.return: void
focal_class.signature: void expandDatabase(final Connection connection, long numBytes)
focal_class.class_method_signature: DBQueries.getDatabaseSize(final Connection connection)
focal_class.full_signature: public static long getDatabaseSize(final Connection connection)
focal_class.identifier: getDatabaseSize
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection)
focal_class.return: long
focal_class.signature: long getDatabaseSize(final Connection connection)
focal_class.class_method_signature: DBQueries.readPragmaLong(final Connection connection, String query)
focal_class.full_signature: static long readPragmaLong(final Connection connection, String query)
focal_class.identifier: readPragmaLong
focal_class.modifiers: static
focal_class.parameters: (final Connection connection, String query)
focal_class.return: long
focal_class.signature: long readPragmaLong(final Connection connection, String query)
focal_class.class_method_signature: DBQueries.bulkAdd(Iterable<Row<K, A>> rows, final String tableName, final Connection connection)
focal_class.full_signature: public static int bulkAdd(Iterable<Row<K, A>> rows, final String tableName, final Connection connection)
focal_class.identifier: bulkAdd
focal_class.modifiers: public static
focal_class.parameters: (Iterable<Row<K, A>> rows, final String tableName, final Connection connection)
focal_class.return: int
focal_class.signature: int bulkAdd(Iterable<Row<K, A>> rows, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.bulkRemove(Iterable<K> objectKeys, final String tableName, final Connection connection)
focal_class.full_signature: public static int bulkRemove(Iterable<K> objectKeys, final String tableName, final Connection connection)
focal_class.identifier: bulkRemove
focal_class.modifiers: public static
focal_class.parameters: (Iterable<K> objectKeys, final String tableName, final Connection connection)
focal_class.return: int
focal_class.signature: int bulkRemove(Iterable<K> objectKeys, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.createAndBindSelectPreparedStatement(final String selectPrefix,
                                                                           final String groupingAndSorting,
                                                                           final List<WhereClause> additionalWhereClauses,
                                                                           final Query<O> query,
                                                                           final Connection connection)
focal_class.full_signature: static PreparedStatement createAndBindSelectPreparedStatement(final String selectPrefix,
                                                                           final String groupingAndSorting,
                                                                           final List<WhereClause> additionalWhereClauses,
                                                                           final Query<O> query,
                                                                           final Connection connection)
focal_class.identifier: createAndBindSelectPreparedStatement
focal_class.modifiers: static
focal_class.parameters: (final String selectPrefix,
                                                                           final String groupingAndSorting,
                                                                           final List<WhereClause> additionalWhereClauses,
                                                                           final Query<O> query,
                                                                           final Connection connection)
focal_class.return: PreparedStatement
focal_class.signature: PreparedStatement createAndBindSelectPreparedStatement(final String selectPrefix,
                                                                           final String groupingAndSorting,
                                                                           final List<WhereClause> additionalWhereClauses,
                                                                           final Query<O> query,
                                                                           final Connection connection)
focal_class.class_method_signature: DBQueries.count(final Query<O> query, final String tableName, final Connection connection)
focal_class.full_signature: public static int count(final Query<O> query, final String tableName, final Connection connection)
focal_class.identifier: count
focal_class.modifiers: public static
focal_class.parameters: (final Query<O> query, final String tableName, final Connection connection)
focal_class.return: int
focal_class.signature: int count(final Query<O> query, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.countDistinct(final Query<O> query, final String tableName, final Connection connection)
focal_class.full_signature: public static int countDistinct(final Query<O> query, final String tableName, final Connection connection)
focal_class.identifier: countDistinct
focal_class.modifiers: public static
focal_class.parameters: (final Query<O> query, final String tableName, final Connection connection)
focal_class.return: int
focal_class.signature: int countDistinct(final Query<O> query, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.search(final Query<O> query, final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet search(final Query<O> query, final String tableName, final Connection connection)
focal_class.identifier: search
focal_class.modifiers: public static
focal_class.parameters: (final Query<O> query, final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet search(final Query<O> query, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getDistinctKeys(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet getDistinctKeys(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.identifier: getDistinctKeys
focal_class.modifiers: public static
focal_class.parameters: (final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet getDistinctKeys(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getKeysAndValues(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet getKeysAndValues(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.identifier: getKeysAndValues
focal_class.modifiers: public static
focal_class.parameters: (final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet getKeysAndValues(final Query<O> query, boolean descending, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getCountOfDistinctKeys(final String tableName, final Connection connection)
focal_class.full_signature: public static int getCountOfDistinctKeys(final String tableName, final Connection connection)
focal_class.identifier: getCountOfDistinctKeys
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: int
focal_class.signature: int getCountOfDistinctKeys(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getDistinctKeysAndCounts(boolean sortByKeyDescending, final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet getDistinctKeysAndCounts(boolean sortByKeyDescending, final String tableName, final Connection connection)
focal_class.identifier: getDistinctKeysAndCounts
focal_class.modifiers: public static
focal_class.parameters: (boolean sortByKeyDescending, final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet getDistinctKeysAndCounts(boolean sortByKeyDescending, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getAllIndexEntries(final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet getAllIndexEntries(final String tableName, final Connection connection)
focal_class.identifier: getAllIndexEntries
focal_class.modifiers: public static
focal_class.parameters: (final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet getAllIndexEntries(final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.getIndexEntryByObjectKey(final K key , final String tableName, final Connection connection)
focal_class.full_signature: public static java.sql.ResultSet getIndexEntryByObjectKey(final K key , final String tableName, final Connection connection)
focal_class.identifier: getIndexEntryByObjectKey
focal_class.modifiers: public static
focal_class.parameters: (final K key , final String tableName, final Connection connection)
focal_class.return: java.sql.ResultSet
focal_class.signature: java.sql.ResultSet getIndexEntryByObjectKey(final K key , final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.contains(final K objectKey, final Query<O> query, final String tableName, final Connection connection)
focal_class.full_signature: public static boolean contains(final K objectKey, final Query<O> query, final String tableName, final Connection connection)
focal_class.identifier: contains
focal_class.modifiers: public static
focal_class.parameters: (final K objectKey, final Query<O> query, final String tableName, final Connection connection)
focal_class.return: boolean
focal_class.signature: boolean contains(final K objectKey, final Query<O> query, final String tableName, final Connection connection)
focal_class.class_method_signature: DBQueries.ensureNotNegative(int value)
focal_class.full_signature: static void ensureNotNegative(int value)
focal_class.identifier: ensureNotNegative
focal_class.modifiers: static
focal_class.parameters: (int value)
focal_class.return: void
focal_class.signature: void ensureNotNegative(int value)
focal_method.body: public static <K, A> void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection){
  
          final String objectKeySQLiteType = DBUtils.getDBTypeForClass(objectKeyClass);
          final String objectValueSQLiteType = DBUtils.getDBTypeForClass(valueClass);
  
          final String sqlCreateTable = String.format(
                  "CREATE TABLE IF NOT EXISTS cqtbl_%s (objectKey %s, value %s, PRIMARY KEY (objectKey, value)) WITHOUT ROWID;",
                  tableName,
                  objectKeySQLiteType,
                  objectValueSQLiteType);
  
          Statement statement = null;
  
          try {
              statement = connection.createStatement();
              statement.executeUpdate(sqlCreateTable);
          }catch (SQLException e){
              throw new IllegalStateException("Unable to create index table: " + tableName, e);
          }finally {
              DBUtils.closeQuietly(statement);
          }
      }
focal_method.class_method_signature: DBQueries.createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_method.full_signature: public static void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_method.identifier: createIndexTable
focal_method.invocations: getDBTypeForClass getDBTypeForClass format createStatement executeUpdate closeQuietly
focal_method.modifiers: public static
focal_method.parameters: (final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)
focal_method.return: void
focal_method.signature: void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection)