rowsetdefinition.java

来自「数据仓库展示程序」· Java 代码 · 共 1,174 行 · 第 1/5 页

JAVA
1,174
字号
                "Returns an XML list of keywords reserved by the provider.",
                new Column[] {
                    Keyword,
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DiscoverKeywordsRowset(restrictions, properties);
            }
        };

        private static final String[] keywords = new String[] {
            "$AdjustedProbability", "$Distance", "$Probability",
            "$ProbabilityStDev", "$ProbabilityStdDeV", "$ProbabilityVariance",
            "$StDev", "$StdDeV", "$Support", "$Variance",
            "AddCalculatedMembers", "Action", "After", "Aggregate", "All",
            "Alter", "Ancestor", "And", "Append", "As", "ASC", "Axis",
            "Automatic", "Back_Color", "BASC", "BDESC", "Before",
            "Before_And_After", "Before_And_Self", "Before_Self_After",
            "BottomCount", "BottomPercent", "BottomSum", "Break", "Boolean",
            "Cache", "Calculated", "Call", "Case", "Catalog_Name", "Cell",
            "Cell_Ordinal", "Cells", "Chapters", "Children",
            "Children_Cardinality", "ClosingPeriod", "Cluster",
            "ClusterDistance", "ClusterProbability", "Clusters",
            "CoalesceEmpty", "Column_Values", "Columns", "Content",
            "Contingent", "Continuous", "Correlation", "Cousin", "Covariance",
            "CovarianceN", "Create", "CreatePropertySet", "CrossJoin", "Cube",
            "Cube_Name", "CurrentMember", "CurrentCube", "Custom", "Cyclical",
            "DefaultMember", "Default_Member", "DESC", "Descendents",
            "Description", "Dimension", "Dimension_Unique_Name", "Dimensions",
            "Discrete", "Discretized", "DrillDownLevel",
            "DrillDownLevelBottom", "DrillDownLevelTop", "DrillDownMember",
            "DrillDownMemberBottom", "DrillDownMemberTop", "DrillTrough",
            "DrillUpLevel", "DrillUpMember", "Drop", "Else", "Empty", "End",
            "Equal_Areas", "Exclude_Null", "ExcludeEmpty", "Exclusive",
            "Expression", "Filter", "FirstChild", "FirstRowset",
            "FirstSibling", "Flattened", "Font_Flags", "Font_Name",
            "Font_size", "Fore_Color", "Format_String", "Formatted_Value",
            "Formula", "From", "Generate", "Global", "Head", "Hierarchize",
            "Hierarchy", "Hierary_Unique_name", "IIF", "IsEmpty",
            "Include_Null", "Include_Statistics", "Inclusive", "Input_Only",
            "IsDescendant", "Item", "Lag", "LastChild", "LastPeriods",
            "LastSibling", "Lead", "Level", "Level_Unique_Name", "Levels",
            "LinRegIntercept", "LinRegR2", "LinRegPoint", "LinRegSlope",
            "LinRegVariance", "Long", "MaxRows", "Median", "Member",
            "Member_Caption", "Member_Guid", "Member_Name", "Member_Ordinal",
            "Member_Type", "Member_Unique_Name", "Members",
            "Microsoft_Clustering", "Microsoft_Decision_Trees", "Mining",
            "Model", "Model_Existence_Only", "Models", "Move", "MTD", "Name",
            "Nest", "NextMember", "Non", "Normal", "Not", "Ntext", "Nvarchar",
            "OLAP", "On", "OpeningPeriod", "OpenQuery", "Or", "Ordered",
            "Ordinal", "Pages", "Pages", "ParallelPeriod", "Parent",
            "Parent_Level", "Parent_Unique_Name", "PeriodsToDate", "PMML",
            "Predict", "Predict_Only", "PredictAdjustedProbability",
            "PredictHistogram", "Prediction", "PredictionScore",
            "PredictProbability", "PredictProbabilityStDev",
            "PredictProbabilityVariance", "PredictStDev", "PredictSupport",
            "PredictVariance", "PrevMember", "Probability",
            "Probability_StDev", "Probability_StdDev", "Probability_Variance",
            "Properties", "Property", "QTD", "RangeMax", "RangeMid",
            "RangeMin", "Rank", "Recursive", "Refresh", "Related", "Rename",
            "Rollup", "Rows", "Schema_Name", "Sections", "Select", "Self",
            "Self_And_After", "Sequence_Time", "Server", "Session", "Set",
            "SetToArray", "SetToStr", "Shape", "Skip", "Solve_Order", "Sort",
            "StdDev", "Stdev", "StripCalculatedMembers", "StrToSet",
            "StrToTuple", "SubSet", "Support", "Tail", "Text", "Thresholds",
            "ToggleDrillState", "TopCount", "TopPercent", "TopSum",
            "TupleToStr", "Under", "Uniform", "UniqueName", "Use", "Value",
            "Value", "Var", "Variance", "VarP", "VarianceP", "VisualTotals",
            "When", "Where", "With", "WTD", "Xor",
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            for (int i = 0; i < keywords.length; i++) {
                String keyword = keywords[i];
                Row row = new Row();
                row.set(Keyword.name, keyword);
                emit(row, saxHandler);
            }
        }
    }

    static class DiscoverLiteralsRowset extends Rowset {
        DiscoverLiteralsRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        public static final RowsetDefinition definition = new RowsetDefinition(
                "DISCOVER_LITERALS", DISCOVER_LITERALS,
                "Returns information about literals supported by the provider.",
                new Column[] {
                    new Column("LiteralName", Type.StringSometimesArray, null, true, false,
                            "The name of the literal described in the row." + nl +
                "Example: DBLITERAL_LIKE_PERCENT"),
                    new Column("LiteralValue", Type.String, null, false, true,
                            "Contains the actual literal value." + nl +
                "Example, if LiteralName is DBLITERAL_LIKE_PERCENT and the percent character (%) is used to match zero or more characters in a LIKE clause, this column's value would be \"%\"."),
                    new Column("LiteralInvalidChars", Type.String, null, false, true,
                            "The characters, in the literal, that are not valid." + nl +
                "For example, if table names can contain anything other than a numeric character, this string would be \"0123456789\"."),
                    new Column("LiteralInvalidStartingChars", Type.String, null, false, true,
                            "The characters that are not valid as the first character of the literal. If the literal can start with any valid character, this is null."),
                    new Column("LiteralMaxLength", Type.Integer, null, false, true,
                            "The maximum number of characters in the literal. If there is no maximum or the maximum is unknown, the value is ?1."),
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DiscoverLiteralsRowset(restrictions, properties);
            }
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            emit(Enumeration.Literal.enumeration, saxHandler);
        }

    }

    static class DbschemaCatalogsRowset extends Rowset {
        DbschemaCatalogsRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        private static final Column CatalogName = new Column("CATALOG_NAME", Type.String, null, true, false, "Catalog name. Cannot be NULL.");
        private static final Column Description = new Column("DESCRIPTION", Type.String, null, false, true, "Human-readable description of the catalog.");

        public static final RowsetDefinition definition = new RowsetDefinition(
                "DBSCHEMA_CATALOGS", DBSCHEMA_CATALOGS,
                "Returns information about literals supported by the provider.",
                new Column[] {
                    CatalogName,
                    Description,
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DbschemaCatalogsRowset(restrictions, properties);
            }
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            Connection connection = XmlaMediator.getConnection(properties);
            if (connection == null) {
                return;
            }
            Row row = new Row();
            final Schema schema = connection.getSchema();
            row.set(CatalogName.name, schema.getName());
            emit(row, saxHandler);
        }
    }

    static class DbschemaColumnsRowset extends Rowset {
        DbschemaColumnsRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        private static final Column TableCatalog = new Column("TABLE_CATALOG", Type.String, null, true, false, null);
        private static final Column TableSchema = new Column("TABLE_SCHEMA", Type.String, null, true, false, null);
        private static final Column TableName = new Column("TABLE_NAME", Type.String, null, true, false, null);
        private static final Column ColumnName = new Column("COLUMN_NAME", Type.String, null, true, false, null);
        public static final RowsetDefinition definition = new RowsetDefinition(
                "DBSCHEMA_COLUMNS", DBSCHEMA_COLUMNS, null, new Column[] {
                    TableCatalog,
                    TableSchema,
                    TableName,
                    ColumnName,
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DbschemaColumnsRowset(restrictions, properties);
            }
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            //TODO
            throw new UnsupportedOperationException();
        }
    }

    static class DbschemaProviderTypesRowset extends Rowset {
        DbschemaProviderTypesRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        private static final Column DataType = new Column("DATA_TYPE", Type.UnsignedInteger, null, true, false, null);
        private static final Column BestMatch = new Column("BEST_MATCH", Type.Boolean, null, true, false, null);
        public static final RowsetDefinition definition = new RowsetDefinition(
                "DBSCHEMA_PROVIDER_TYPES", DBSCHEMA_PROVIDER_TYPES, null, new Column[] {
                    DataType,
                    BestMatch,
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DbschemaProviderTypesRowset(restrictions, properties);
            }
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            //TODO
            throw new UnsupportedOperationException();
        }
    }

    static class DbschemaTablesRowset extends Rowset {
        DbschemaTablesRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        private static final Column TableCatalog = new Column("TABLE_CATALOG", Type.String, null, true, false, null);
        private static final Column TableSchema = new Column("TABLE_SCHEMA", Type.String, null, true, false, null);
        private static final Column TableName = new Column("TABLE_NAME", Type.String, null, true, false, null);
        private static final Column TableType = new Column("TABLE_TYPE", Type.String, null, true, false, null);
        public static final RowsetDefinition definition = new RowsetDefinition(
                "DBSCHEMA_TABLES", DBSCHEMA_TABLES, null, new Column[] {
                    TableCatalog,
                    TableSchema,
                    TableName,
                    TableType,
                }) {
            public Rowset getRowset(HashMap restrictions, Properties properties) {
                return new DbschemaTablesRowset(restrictions, properties);
            }
        };

        public void unparse(SAXHandler saxHandler) throws SAXException {
            //TODO
            throw new UnsupportedOperationException();
        }
    }

    static class DbschemaTablesInfoRowset extends Rowset {
        DbschemaTablesInfoRowset(HashMap restrictions, Properties properties) {
            super(definition, restrictions, properties);
        }

        private static final Column TableCatalog = new Column("TABLE_CATALOG", Type.String, null, true, false, null);
        private static final Column TableSchema = new Column("TABLE_SCHEMA", Type.String, null, true, false, null);
        private static final Column TableName = new Column("TABLE_NAME", Type.String, null, true, false, null);
        private static final Column TableType = new Column("TABLE_TYPE", Type.String, null, true, false, null);
        public static final RowsetDefinition definition = new RowsetDefinition(
                "DBSCHEMA_TABLES_INFO", DBSCHEMA_TABLES_INFO, null, new Column[] {
                    TableCatalog,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?