KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > catalog > SYSDUMMY1RowFactory


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.catalog.SYSDUMMY1RowFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.catalog;
23
24 import java.sql.Types JavaDoc;
25
26 import org.apache.derby.iapi.sql.dictionary.SystemColumn;
27 import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;
28 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
29 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
30 import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;
31
32 import org.apache.derby.iapi.error.StandardException;
33
34 import org.apache.derby.iapi.services.sanity.SanityManager;
35 import org.apache.derby.iapi.sql.execute.ExecRow;
36 import org.apache.derby.iapi.sql.execute.ExecIndexRow;
37 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
38 import org.apache.derby.iapi.types.DataValueFactory;
39 import org.apache.derby.iapi.types.RowLocation;
40 import org.apache.derby.iapi.types.DataValueDescriptor;
41 import org.apache.derby.iapi.services.uuid.UUIDFactory;
42 import org.apache.derby.catalog.UUID;
43
44 /**
45  * Factory for creating a SYSDUMMY1 row.
46  *
47  * @version 0.01
48  *
49  */

50
51 class SYSDUMMY1RowFactory extends CatalogRowFactory
52 {
53     protected static final int SYSDUMMY1_COLUMN_COUNT = 1;
54
55     private static final String JavaDoc[] uuids =
56     {
57         "c013800d-00f8-5b70-bea3-00000019ed88", // catalog UUID
58
"c013800d-00f8-5b70-fee8-000000198c88" // heap UUID.
59
};
60
61     /*
62      * CONSTRUCTORS
63      */

64     SYSDUMMY1RowFactory(UUIDFactory uuidf,
65                                     ExecutionFactory ef,
66                                     DataValueFactory dvf,
67                                     boolean convertIdToLower)
68     {
69         super(uuidf,ef,dvf,convertIdToLower);
70         
71         initInfo(SYSDUMMY1_COLUMN_COUNT, "SYSDUMMY1",
72                  null, null, uuids);
73     }
74
75
76   /**
77      * Make a SYSDUMMY1 row
78      *
79      *
80      * @return Row suitable for inserting into SYSSTATISTICS.
81      *
82      * @exception StandardException thrown on failure
83      */

84
85     public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
86                     throws StandardException
87     {
88         ExecRow row = getExecutionFactory().getValueRow(SYSDUMMY1_COLUMN_COUNT);
89         
90         row.setColumn(1, dvf.getCharDataValue("Y"));
91         return row;
92     }
93     
94     public TupleDescriptor buildDescriptor(
95          ExecRow row,
96          TupleDescriptor parentDesc,
97          DataDictionary dd)
98         throws StandardException
99          
100     {
101         return null;
102     }
103
104     /**
105      * Builds a list of columns suitable for creating this Catalog.
106      *
107      *
108      * @return array of SystemColumn suitable for making this catalog.
109      */

110     public SystemColumn[] buildColumnList()
111     {
112         return new SystemColumn[] {
113                 SystemColumnImpl.getColumn("IBMREQD", Types.CHAR, true, 1)
114         };
115     }
116
117
118 }
119
Popular Tags