class TableIsEmptyGenerator extends AbstractSqlGenerator<TableIsEmptyStatement> {

    @Override
    public int getPriority() {
        return PRIORITY_DEFAULT;
    }

    @Override
    public boolean supports(TableIsEmptyStatement statement, Database database) {
        return true;
    }

    @Override
    public ValidationErrors validate(TableIsEmptyStatement tableIsEmptyStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        ValidationErrors validationErrors = new ValidationErrors();
        validationErrors.checkRequiredField("tableName", tableIsEmptyStatement.getTableName());
        return validationErrors;
    }

    protected String generateCountSql(TableIsEmptyStatement statement, Database database) {<FILL_FUNCTION_BODY>}


    @Override
    public Sql[] generateSql(TableIsEmptyStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        return new Sql[] { new UnparsedSql(generateCountSql(statement, database)) };
    }
}

        String tableName = database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName());
        if (database instanceof HsqlDatabase || database instanceof DB2Database) {
            return String.format("SELECT COUNT(1) FROM (VALUES(0)) WHERE EXISTS (SELECT * FROM %s)", tableName);
        }
        if (database instanceof Db2zDatabase) {
            return String.format("SELECT COUNT(1) FROM SYSIBM.SYSDUMMY1 WHERE EXISTS (SELECT * FROM %s)", tableName);
        }
        if (database instanceof OracleDatabase || database instanceof MySQLDatabase) {
            return String.format("SELECT COUNT(1) FROM DUAL WHERE EXISTS (SELECT * FROM %s)", tableName);
        }
        if (database instanceof FirebirdDatabase) {
            return String.format("SELECT COUNT(1) FROM RDB$DATABASE WHERE EXISTS (SELECT * FROM %s)", tableName);
        }
        return String.format("SELECT COUNT(1) WHERE EXISTS (SELECT * FROM %s)", tableName);
    
<methods>public non-sealed void <init>() ,public boolean generateRollbackStatementsIsVolatile(liquibase.database.Database) ,public boolean generateStatementsIsVolatile(liquibase.database.Database) ,public int getPriority() ,public boolean looksLikeFunctionCall(java.lang.String, liquibase.database.Database) ,public boolean supports(liquibase.statement.core.TableIsEmptyStatement, liquibase.database.Database) ,public liquibase.exception.Warnings warn(liquibase.statement.core.TableIsEmptyStatement, liquibase.database.Database, SqlGeneratorChain<liquibase.statement.core.TableIsEmptyStatement>) <variables>