Deveel.Data.Sql.Query.FromTableSubQuerySource.Matches C# (CSharp) Method

Matches() private method

private Matches ( ObjectName name, string catalog, string schema, string table, string column ) : bool
name ObjectName
catalog string
schema string
table string
column string
return bool
        private bool Matches(ObjectName name, string catalog, string schema, string table, string column)
        {
            var tableName = name.Parent;
            var schemaName = tableName == null ? null : tableName.Parent;
            var catalogName = schemaName == null ? null : schemaName.Parent;
            var columnName = name.Name;

            if (column == null)
                return true;
            if (!StringCompare(columnName, column))
                return false;

            if (table == null)
                return true;
            if (tableName == null)
                return false;

            string tname = tableName.Name;
            if (tname != null && !StringCompare(tname, table))
                return false;

            if (schema == null)
                return true;

            string sname = schemaName != null ? schemaName.Name : null;
            if (sname != null && !StringCompare(sname, schema))
                return false;

            string cname = catalogName != null ? catalogName.Name : null;
            if (cname != null && !StringCompare(cname, catalog))
                return false;

            return true;
        }