@Test public void testCheckTable() throws Exception { PlaceholderSet<Placeholder> placeholders = new PlaceholderSet<>(); placeholders.add(new SimplePlaceholder("playersTable") { @Nullable @Override public String apply(PlaceholderData input) { return input.getPlaceholder().equals("playersTable") ? "myPlayersTable" : null; } }); boolean result = database.checkTable("myTableId", placeholders); assertTrue(result); System.out .println(SQLUtils.hasTable(database.getJdbcAgent().getDataSource(), "myPlayersTable")); JdbcTemplate template = database.getJdbcAgent().createJdbcTemplate(); result = ((boolean) template.query( "SELECT `name` FROM `SQLITE_MASTER`", new ResultSetExtractor<Object>() { @Override public Object extractData(ResultSet rs) throws SQLException, DataAccessException { while (rs.next()) { if (rs.getString(1).equalsIgnoreCase("myPlayersTable")) { return true; } } return false; } })); }
@Nullable public Boolean checkTable(@Nonnull String tableId) { checkNotNullOrEmpty(tableId, "tableId"); Table table = getTable(tableId); return table != null ? checkTable(table) : null; }
SQLDatabase { @Nullable public Boolean checkTable(@Nonnull String tableId) { checkNotNullOrEmpty(tableId, "tableId"); Table table = getTable(tableId); return table != null ? checkTable(table) : null; } }
SQLDatabase { @Nullable public Boolean checkTable(@Nonnull String tableId) { checkNotNullOrEmpty(tableId, "tableId"); Table table = getTable(tableId); return table != null ? checkTable(table) : null; } SQLDatabase(@Nonnull Logger logger, @Nonnull SpringJDBCAgent jdbcAgent); }
SQLDatabase { @Nullable public Boolean checkTable(@Nonnull String tableId) { checkNotNullOrEmpty(tableId, "tableId"); Table table = getTable(tableId); return table != null ? checkTable(table) : null; } SQLDatabase(@Nonnull Logger logger, @Nonnull SpringJDBCAgent jdbcAgent); void checkTables(); void checkTables(@Nullable PlaceholderSet placeholderSet); @Nullable Boolean checkTable(@Nonnull String tableId); boolean checkTable(@Nonnull Table table); @Nullable Boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull String tableId); boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull Table table); @Nullable Boolean checkTable(@Nonnull String tableId,
                            @Nullable PlaceholderSet placeholders); boolean checkTable(@Nonnull Table table,
                            @Nullable PlaceholderSet placeholders); boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull Table table,
                            @Nullable PlaceholderSet placeholders); SpringJDBCAgent getJdbcAgent(); TableMap getTableMap(); boolean hasTable(@Nonnull String tableId); boolean hasTable(@Nonnull Table table); boolean hasTableByName(@Nonnull String tableName); @Nullable String getTableIdByName(@Nullable String tableName); @Nullable Table getTable(@Nullable String tableId); @Nullable String getTableName(@Nullable String tableId); void addTable(@Nonnull String id, @Nonnull String name); void addTable(@Nonnull String id, @Nonnull String name, @Nullable String schema); void addTable(@Nonnull String id, @Nonnull Table table); boolean removeTable(@Nonnull Table table); @Nullable Table removeTable(@Nonnull String id); Map<String, Table> getTables(); }
SQLDatabase { @Nullable public Boolean checkTable(@Nonnull String tableId) { checkNotNullOrEmpty(tableId, "tableId"); Table table = getTable(tableId); return table != null ? checkTable(table) : null; } SQLDatabase(@Nonnull Logger logger, @Nonnull SpringJDBCAgent jdbcAgent); void checkTables(); void checkTables(@Nullable PlaceholderSet placeholderSet); @Nullable Boolean checkTable(@Nonnull String tableId); boolean checkTable(@Nonnull Table table); @Nullable Boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull String tableId); boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull Table table); @Nullable Boolean checkTable(@Nonnull String tableId,
                            @Nullable PlaceholderSet placeholders); boolean checkTable(@Nonnull Table table,
                            @Nullable PlaceholderSet placeholders); boolean checkTable(@Nonnull JdbcTemplate template, @Nonnull Table table,
                            @Nullable PlaceholderSet placeholders); SpringJDBCAgent getJdbcAgent(); TableMap getTableMap(); boolean hasTable(@Nonnull String tableId); boolean hasTable(@Nonnull Table table); boolean hasTableByName(@Nonnull String tableName); @Nullable String getTableIdByName(@Nullable String tableName); @Nullable Table getTable(@Nullable String tableId); @Nullable String getTableName(@Nullable String tableId); void addTable(@Nonnull String id, @Nonnull String name); void addTable(@Nonnull String id, @Nonnull String name, @Nullable String schema); void addTable(@Nonnull String id, @Nonnull Table table); boolean removeTable(@Nonnull Table table); @Nullable Table removeTable(@Nonnull String id); Map<String, Table> getTables();  }