コード例 #1
0
        private bool GetOrderValuesCaseSensitiveFromTables(SelectCommandContext selectCommandContext, SchemaMetaData schemaMetaData, OrderByItem eachOrderByItem)
        {
            foreach (var simpleTableSegment in selectCommandContext.GetAllTables())
            {
                var tableName     = simpleTableSegment.GetTableName().GetIdentifier().GetValue();
                var tableMetaData = schemaMetaData.Get(tableName);
                IDictionary <String, ColumnMetaData> columns = tableMetaData.GetColumns();
                var orderByItemSegment = eachOrderByItem.GetSegment();
                if (orderByItemSegment is ColumnOrderByItemSegment columnOrderByItemSegment)
                {
                    String columnName = columnOrderByItemSegment.GetColumn().GetIdentifier().GetValue();
                    if (columns.ContainsKey(columnName))
                    {
                        return(columns[columnName].CaseSensitive);
                    }
                }
                else if (orderByItemSegment is IndexOrderByItemSegment indexOrderByItemSegment)
                {
                    int    columnIndex = indexOrderByItemSegment.GetColumnIndex();
                    String columnName  = _streamDataReader.GetColumnName(columnIndex);
                    if (columns.ContainsKey(columnName))
                    {
                        return(columns[columnName].CaseSensitive);
                    }
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }
コード例 #2
0
        private bool GetValueCaseSensitiveFromTables(IStreamDataReader streamDataReader, SelectCommandContext selectCommandContext,
                                                     SchemaMetaData schemaMetaData, int columnIndex)
        {
            foreach (var simpleTableSegment in selectCommandContext.GetAllTables())
            {
                String        tableName     = simpleTableSegment.GetTableName().GetIdentifier().GetValue();
                TableMetaData tableMetaData = schemaMetaData.Get(tableName);
                IDictionary <String, ColumnMetaData> columns = tableMetaData.GetColumns();
                String columnName = streamDataReader.GetColumnName(columnIndex);
                if (columns.ContainsKey(columnName))
                {
                    return(columns[columnName].CaseSensitive);
                }
            }

            return(false);
        }