001: /*
002:
003: Derby - Class org.apache.derby.impl.sql.catalog.SYSDUMMY1RowFactory
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.impl.sql.catalog;
023:
024: import java.sql.Types;
025:
026: import org.apache.derby.iapi.sql.dictionary.SystemColumn;
027: import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;
028: import org.apache.derby.iapi.sql.dictionary.DataDictionary;
029: import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
030: import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;
031:
032: import org.apache.derby.iapi.error.StandardException;
033:
034: import org.apache.derby.iapi.services.sanity.SanityManager;
035: import org.apache.derby.iapi.sql.execute.ExecRow;
036: import org.apache.derby.iapi.sql.execute.ExecIndexRow;
037: import org.apache.derby.iapi.sql.execute.ExecutionFactory;
038: import org.apache.derby.iapi.types.DataValueFactory;
039: import org.apache.derby.iapi.types.RowLocation;
040: import org.apache.derby.iapi.types.DataValueDescriptor;
041: import org.apache.derby.iapi.services.uuid.UUIDFactory;
042: import org.apache.derby.catalog.UUID;
043:
044: /**
045: * Factory for creating a SYSDUMMY1 row.
046: *
047: * @version 0.01
048: *
049: */
050:
051: class SYSDUMMY1RowFactory extends CatalogRowFactory {
052: protected static final int SYSDUMMY1_COLUMN_COUNT = 1;
053:
054: private static final String[] uuids = {
055: "c013800d-00f8-5b70-bea3-00000019ed88", // catalog UUID
056: "c013800d-00f8-5b70-fee8-000000198c88" // heap UUID.
057: };
058:
059: /*
060: * CONSTRUCTORS
061: */
062: SYSDUMMY1RowFactory(UUIDFactory uuidf, ExecutionFactory ef,
063: DataValueFactory dvf, boolean convertIdToLower) {
064: super (uuidf, ef, dvf, convertIdToLower);
065:
066: initInfo(SYSDUMMY1_COLUMN_COUNT, "SYSDUMMY1", null, null, uuids);
067: }
068:
069: /**
070: * Make a SYSDUMMY1 row
071: *
072: *
073: * @return Row suitable for inserting into SYSSTATISTICS.
074: *
075: * @exception StandardException thrown on failure
076: */
077:
078: public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
079: throws StandardException {
080: ExecRow row = getExecutionFactory().getValueRow(
081: SYSDUMMY1_COLUMN_COUNT);
082:
083: row.setColumn(1, dvf.getCharDataValue("Y"));
084: return row;
085: }
086:
087: public TupleDescriptor buildDescriptor(ExecRow row,
088: TupleDescriptor parentDesc, DataDictionary dd)
089: throws StandardException
090:
091: {
092: return null;
093: }
094:
095: /**
096: * Builds a list of columns suitable for creating this Catalog.
097: *
098: *
099: * @return array of SystemColumn suitable for making this catalog.
100: */
101: public SystemColumn[] buildColumnList() {
102: return new SystemColumn[] { SystemColumnImpl.getColumn(
103: "IBMREQD", Types.CHAR, true, 1) };
104: }
105:
106: }
|