Checks if all required tables are present

@throws Exception    if a table is not found
195083
protected function checkRequiredTables()
    {

        // check if relevant tables are present in the list
        foreach ([
                     config('pxlcms.tables.meta.modules'),
                     config('pxlcms.tables.meta.fields'),
                     config('pxlcms.tables.meta.field_options_choices'),
                     //config('pxlcms.tables.meta.groups'),
                     //config('pxlcms.tables.meta.sections'),
                     //config('pxlcms.tables.meta.field_types'),
                     //config('pxlcms.tables.meta.tabs'),
                     //config('pxlcms.tables.meta.users'),
                     //config('pxlcms.tables.meta.field_options_resizes'),

                     config('pxlcms.tables.languages'),
                     config('pxlcms.tables.categories'),
                     config('pxlcms.tables.files'),
                     config('pxlcms.tables.images'),
                     config('pxlcms.tables.references'),
                     config('pxlcms.tables.checkboxes'),
                     //config('pxlcms.tables.slugs'),

                 ] as $checkTable
        ) {
            if ( ! in_array($checkTable, $this->tables)) {

                throw new Exception("Could not find expected CMS table in database: '{$checkTable}'");
            }
        }
    }
1122593
public function check(Table $table)
    {
        $columns = $table->getColumns();
        foreach ($columns as $id => $params) {
            if (!isset($params['sql_id']))
                throw new \Exception("No 'sql_id' param for ID $id");
        }

        $backupSqlAnds = $this->sqlAnds;
        $backupSqlParams = $this->sqlParams;

        $successfulFilters = [];
        foreach ($table->getFilters() as $column => $filterData) {
            $successfulNames = [];
            foreach ($filterData as $name => $value) {
                if ($this->buildFilter($columns[$column]['sql_id'], $columns[$column]['type'], $name, $value))
                    $successfulNames[$name] = $value;
            }
            if (count($successfulNames) > 0)
                $successfulFilters[$column] = $successfulNames;
        }
        $table->setFilters($successfulFilters);

        $this->sqlAnds = $backupSqlAnds;
        $this->sqlParams = $backupSqlParams;
        return $this;
    }
1211945
@Override
	public void afterPropertiesSet() throws Exception {
		super.afterPropertiesSet();
		Assert.notNull(sql, "The SQL query must be provided");
		Assert.notNull(rowMapper, "RowMapper must be provided");
	}
476838
public function check(Table $table)
    {
        foreach ($table->getColumns() as $id => $params) {
            if (!isset($params['sql_id']))
                throw new \Exception("No 'sql_id' param for ID $id");
        }

        $backupSqlWhere = $this->sqlWhere;
        $backupSqlParams = $this->sqlParams;

        $columns = $table->getColumns();
        $successfulFilters = [];
        foreach ($table->getFilters() as $column => $filters) {
            $successfulNames = [];
            foreach ($filters as $name => $value) {
                if ($this->buildFilter($columns[$column]['sql_id'], $columns[$column]['type'], $name, $value))
                    $successfulNames[$name] = $value;
            }
            if (count($successfulNames) > 0)
                $successfulFilters[$column] = $successfulNames;
        }
        $table->setFilters($successfulFilters);

        $this->sqlWhere = $backupSqlWhere;
        $this->sqlParams = $backupSqlParams;
    }
1235861
@Override
    protected void validate(List<TableInfo> tableInfos)
    {
        try
        {
            if (!checkForDBExistence())
            {
                throw new SchemaGenerationException("Database " + databaseName + " not exist");
            }

            for (TableInfo tableInfo : tableInfos)
            {
                Map<String, MapReduce> views = new HashMap<String, MapReduce>();
                String id = CouchDBConstants.DESIGN + tableInfo.getTableName();
                CouchDBDesignDocument designDocument = getDesignDocument(id);
                designDocument.setLanguage(CouchDBConstants.LANGUAGE);
                views = designDocument.getViews();
                if (views == null)
                {
                    logger.warn("No view exist for table " + tableInfo.getTableName()
                            + "so any query will not produce any result");
                    return;
                }
                for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed())
                {
                    if (views.get(indexInfo.getColumnName()) == null)
                    {
                        logger.warn("No view exist for column " + indexInfo.getColumnName() + " of table "
                                + tableInfo.getTableName() + "so any query on column " + indexInfo.getColumnName()
                                + "will not produce any result");
                    }
                }

                // for id column.
                if (views.get(tableInfo.getIdColumnName()) == null)
                {
                    logger.warn("No view exist for id column " + tableInfo.getIdColumnName() + " of table "
                            + tableInfo.getTableName() + "so any query on id column " + tableInfo.getIdColumnName()
                            + "will not produce any result");
                }

                // for select all.
                if (views.get("all") == null)
                {
                    logger.warn("No view exist for select all for table " + tableInfo.getTableName()
                            + "so select all query will not produce any result");
                }
            }
        }
        catch (Exception e)
        {
            throw new SchemaGenerationException("Database " + databaseName + " not exist");
        }
    }
295644
public function has_table()
    {
        if (null === $this->table) {
            $this->set_error('This model is has no table specified', true);
        } elseif (false === $this->table) {
            return false;
        }
    }
408006
private function check_tables() {
		$tab = new AdminStoreTables();
		$tab::init($this);
		$force = $this->force_create_table;
		if ($tab::exists($force)) {
			if (!$force)
				$tab::upgrade();
			$tab::deinit();
			return;
		}
		$tab::install($this->expiration);
		$tab::deinit();
	}
462535
public static boolean doesTableExist(JdbcOperations jdbcOperations, final String table) {

        final boolean tableExists =
                jdbcOperations.execute(
                        new ConnectionCallback<Boolean>() {
                            @Override
                            public Boolean doInConnection(Connection con)
                                    throws SQLException, DataAccessException {

                                final DatabaseMetaData metaData = con.getMetaData();
                                final ResultSet tables =
                                        metaData.getTables(
                                                null, null, null, new String[] {"TABLE"});
                                while (tables.next()) {
                                    final String dbTableName = tables.getString("TABLE_NAME");
                                    if (table.equalsIgnoreCase(dbTableName)) {
                                        return true;
                                    }
                                }

                                return false;
                            }
                        });
        return tableExists;
    }
1275282
protected boolean existsTable(){
        try {
            int count = sqlManager.getSingleResult(Integer.class,
                    new StringSqlResource(String.format("SELECT COUNT(*) FROM %s", tableName)));

            if(count == 0){
                // TODO Should insert an initial record?
                return false;
            }
            return true;

        } catch(SQLRuntimeException ex){
            return false;
        }
    }
897727
@Override
    protected void create(List<TableInfo> tableInfos)
    {

        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                if (client.tableExists(tableInfo.getTableName()))
                {
                    client.deleteTable(tableInfo.getTableName());
                }
            }
            catch (Exception e)
            {
                logger.error("Cannot check table existence for table " + tableInfo.getTableName() + ". Caused By: " + e);
                throw new KunderaException("Cannot check table existence for table " + tableInfo.getTableName()
                        + ". Caused By: " + e);
            }
            createKuduTable(tableInfo);
        }
    }
1114681
protected function validateTable($table)
    {
        $this->checkTableArgument($table);
        if (!$this->hasTable($table)) {
            throw new Exception\TableNotFoundException(__METHOD__ . ": Table '$table' does not exists in database '{$this->schema}'");
        }

        return $this;
    }
1329378
private function checksSectionTable()
    {
        $qb = $this->repo->createQueryBuilder('s');
        $this->output->write(' - BackBee database version:  - ');
        try {
            $qb->where('s._has_children = :true')
                ->orWhere('s._has_children = :false')
                ->setMaxResults(1)
                ->setParameters([':true' => true, ':false' => false])
                ->getQuery()
                ->execute();
        } catch (\Exception $e) {
            $this->output->writeln("<error>Failed</error>");
            throw new BBException('Please run "backbee bbapp:update" before this command');
        }
        $this->output->writeln('<info>OK</info>');

        return $this;
    }
720387
protected function hasOldTables() {
        if(!file_exists(ASSETS_PATH.'/.codeBankMigrated')) {
            $tables=DB::tableList();
            if(array_key_exists('snippits', $tables) && array_key_exists('snippit_search', $tables)) {
                return true;
            }else {
                touch(ASSETS_PATH.'/.codeBankMigrated');
            }
        }
        
        return false;
    }
861322
protected void check(Instances data) throws Exception {
    if (m_Owner == null)
      throw new IllegalStateException("No owner set!");
    if (data == null)
      throw new IllegalStateException("No data provided!");
  }
313287
def _table_exists(self):
        """"""
        self.cursor.execute("SHOW TABLES")
        for table in self.cursor.fetchall():
            if table[0].lower() == self.name.lower():
                return True
        return False
1311857
def table_exists(self, table):
        
        if not self.dataset_exists(table.dataset):
            return False

        try:
            self.client.tables().get(projectId=table.project_id,
                                     datasetId=table.dataset_id,
                                     tableId=table.table_id).execute()
        except http.HttpError as ex:
            if ex.resp.status == 404:
                return False
            raise

        return True
278162
public function verifyListIsEmpty(): void
    {
        $firstRowValue = $this->adminLists['Content items']->table->getCellValue(1, 1);

        if (
        !($this->adminLists['Content items']->table->getItemCount() === 1 &&
            strpos($firstRowValue, 'No content items.') !== false)
        ) {
            throw new \Exception('"Content items" list is not empty.');
        }
    }