db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r564792 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/
Date Fri, 10 Aug 2007 22:45:51 GMT
Author: djd
Date: Fri Aug 10 15:45:49 2007
New Revision: 564792

URL: http://svn.apache.org/viewvc?view=rev&rev=564792
Log:
DERBY-1734 (partial) Switch to simpler definition of system columns for a number of system
tables

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -55,6 +55,7 @@
 
 import org.apache.derby.catalog.IndexDescriptor;
 
+import java.sql.Types;
 import java.util.Properties;
 
 /**
@@ -425,106 +426,19 @@
 	 *
 	 * @return array of SystemColumn suitable for making this catalog.
 	 */
+    	        
 	public SystemColumn[]	buildColumnList()
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSCONGLOMERATES_COLUMN_COUNT];
-
-		// describe columns
-
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "SCHEMAID"),			// column name
-							SYSCONGLOMERATES_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "TABLEID"),			// column name
-							SYSCONGLOMERATES_TABLEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CONGLOMERATENUMBER"),		// column name
-							SYSCONGLOMERATES_CONGLOMERATENUMBER,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"BIGINT",				// dataType
-							true,				// built-in type
-							TypeId.LONGINT_MAXWIDTH	// maxLength
-			               );
-
-		columnList[index++] =
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "CONGLOMERATENAME"),				// column name
-							SYSCONGLOMERATES_CONGLOMERATENAME,
-							true				// nullability
-							);
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "ISINDEX"),			// column name
-							SYSCONGLOMERATES_ISINDEX,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"BOOLEAN",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			               );
-
-		columnList[index++] =
-					new SystemColumnImpl(
-							convertIdCase( "DESCRIPTOR"),				// column name
-							SYSCONGLOMERATES_DESCRIPTOR,
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"org.apache.derby.catalog.IndexDescriptor",	// datatype
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN
-												// maxLength
-							);
-
-		columnList[index++] =
-					new SystemColumnImpl(
-							convertIdCase( "ISCONSTRAINT"),				// column name
-							SYSCONGLOMERATES_ISCONSTRAINT,
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"BOOLEAN",	// datatype
-							true,				// built-in type
-							1					// maxLength
-							);
-
-		columnList[index++] =
-					new SystemColumnImpl(
-							convertIdCase( "CONGLOMERATEID"),	// column name
-							SYSCONGLOMERATES_CONGLOMERATEID,
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// datatype
-							true,				// built-in type
-							36					// maxLength
-							);
-
-		return	columnList;
-
+            return new SystemColumn[] {
+               SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+               SystemColumnImpl.getUUIDColumn("TABLEID", false),
+               SystemColumnImpl.getColumn("CONGLOMERATENUMBER", Types.BIGINT, false),
+               SystemColumnImpl.getIdentifierColumn("CONGLOMERATENAME", true),
+               SystemColumnImpl.getColumn("ISINDEX", Types.BOOLEAN, false),
+               SystemColumnImpl.getJavaColumn("DESCRIPTOR",
+                       "org.apache.derby.catalog.IndexDescriptor", true),
+               SystemColumnImpl.getColumn("ISCONSTRAINT", Types.BOOLEAN, true),
+               SystemColumnImpl.getUUIDColumn("CONGLOMERATEID", false)
+           };
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
+
 import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -669,91 +671,15 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSCONSTRAINTS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CONSTRAINTID"),			// column name
-							SYSCONSTRAINTS_CONSTRAINTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "TABLEID"),			// column name
-							SYSCONSTRAINTS_TABLEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] =
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "CONSTRAINTNAME"),	// column name
-							SYSCONSTRAINTS_CONSTRAINTNAME,
-							false				// nullability
-							);
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "TYPE"),			// column name
-							SYSCONSTRAINTS_TYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			               );
-
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "SCHEMAID"),		// column name
-							SYSCONSTRAINTS_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "STATE"),		// column name
-							SYSCONSTRAINTS_STATE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "REFERENCECOUNT"),		// column name
-							SYSCONSTRAINTS_REFERENCECOUNT,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"INTEGER",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			               );
-		return	columnList;
+            return new SystemColumn[] {
+               SystemColumnImpl.getUUIDColumn("CONSTRAINTID", false),
+               SystemColumnImpl.getUUIDColumn("TABLEID", false),
+               SystemColumnImpl.getIdentifierColumn("CONSTRAINTNAME", false),
+               SystemColumnImpl.getIndicatorColumn("TYPE"),
+               SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+               SystemColumnImpl.getIndicatorColumn("STATE"),
+               SystemColumnImpl.getColumn("REFERENCECOUNT", Types.INTEGER, false) 
+            };
 	}
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
+
 import org.apache.derby.catalog.DependableFinder;
 import org.apache.derby.catalog.TypeDescriptor;
 import org.apache.derby.catalog.UUID;
@@ -231,59 +233,13 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSDEPENDS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "DEPENDENTID"),			// column name
-							SYSDEPENDS_DEPENDENTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "DEPENDENTFINDER"),		// column name
-							SYSDEPENDS_DEPENDENTTYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"org.apache.derby.catalog.DependableFinder",	    // dataType
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-			               );
-
-		columnList[index++] =
-					new SystemColumnImpl(
-							convertIdCase( "PROVIDERID"),		// column name
-							SYSDEPENDS_PROVIDERID,
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// datatype
-							true,				// built-in type
-							36					// maxLength
-							);
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "PROVIDERFINDER"),			// column name
-							SYSDEPENDS_PROVIDERTYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"org.apache.derby.catalog.DependableFinder",	    // dataType
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-			               );
-
-		return	columnList;
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("DEPENDENTID", false),
+                SystemColumnImpl.getJavaColumn("DEPENDENTFINDER",
+                        "org.apache.derby.catalog.DependableFinder", false),
+                SystemColumnImpl.getUUIDColumn("PROVIDERID", false),
+                SystemColumnImpl.getJavaColumn("PROVIDERFINDER",
+                        "org.apache.derby.catalog.DependableFinder", false),
+           };
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
+
 import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -246,64 +248,14 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSFOREIGNKEYS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "CONSTRAINTID"),			// name 
-							SYSFOREIGNKEYS_CONSTRAINTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "CONGLOMERATEID"),			// name 
-							SYSFOREIGNKEYS_CONGLOMERATEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "KEYCONSTRAINTID"),			// name 
-							SYSFOREIGNKEYS_KEYCONSTRAINTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "DELETERULE"),			// name 
-							SYSFOREIGNKEYS_DELETERULE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "UPDATERULE"),			// name 
-							SYSFOREIGNKEYS_UPDATERULE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-		return	columnList;
+            return new SystemColumn[] {
+                 SystemColumnImpl.getUUIDColumn("CONSTRAINTID", false),
+                 SystemColumnImpl.getUUIDColumn("CONGLOMERATEID", false),
+                 SystemColumnImpl.getUUIDColumn("KEYCONSTRAINTID", false),
+                 SystemColumnImpl.getIndicatorColumn("DELETERULE"),
+                 SystemColumnImpl.getIndicatorColumn("UPDATERULE"),
+           
+            };
 	}
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -200,36 +200,10 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSKEYS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CONSTRAINTID"),			// column name
-							SYSKEYS_CONSTRAINTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CONGLOMERATEID"),	// column name
-							SYSKEYS_CONGLOMERATEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			               );
-
-		return	columnList;
-	}
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("CONSTRAINTID", false),
+                SystemColumnImpl.getUUIDColumn("CONGLOMERATEID", false),
+            };
+        }
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -223,36 +223,10 @@
 	 */
 	public SystemColumn[]	buildColumnList() 
 	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSSCHEMAS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "SCHEMAID"),			// name 
-							SYSSCHEMAS_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		columnList[index++] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "SCHEMANAME"),		// column name
-							SYSSCHEMAS_SCHEMANAME,	// column number
-							false				// nullability
-							);
-
-		columnList[index++] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "AUTHORIZATIONID"),	// column name
-							SYSSCHEMAS_SCHEMAAID,	// column number
-							false				// nullability
-							);
-
-
-		return	columnList;
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+                SystemColumnImpl.getIdentifierColumn("SCHEMANAME", false),
+                SystemColumnImpl.getIdentifierColumn("AUTHORIZATIONID", false),
+            };
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -59,6 +59,7 @@
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import java.sql.Timestamp;
+import java.sql.Types;
 import java.util.Properties;
 
 /**
@@ -384,113 +385,19 @@
 	 */
 	public SystemColumn[] buildColumnList()
 	{
-		/*
-		** Create one less than the number of columns, we
-		** skip the last one deliberately.
-		*/	
-		SystemColumn[]	columnList = new SystemColumn[SYSSTATEMENTS_COLUMN_COUNT - SYSSTATEMENTS_HIDDEN_COLUMN_COUNT];
-
-
-		// describe columns
-		columnList[0] = new SystemColumnImpl(	
-							convertIdCase( "STMTID"),			// name 
-							SYSSTATEMENTS_STMTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[1] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "STMTNAME"),			// column name
-							SYSSTATEMENTS_STMTNAME,	// column number
-							false				// nullability
-							);
-
-		columnList[2] = new SystemColumnImpl(	
-							convertIdCase( "SCHEMAID"),				// name 
-							SYSSTATEMENTS_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[3] = 
-					new SystemColumnImpl(		
-							convertIdCase( "TYPE"),				// name 
-							SYSSTATEMENTS_TYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[4] = 
-					new SystemColumnImpl(		
-							convertIdCase( "VALID"),			// name 
-							SYSSTATEMENTS_VALID,// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"BOOLEAN",			// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[5] = 
-					new SystemColumnImpl(		
-							convertIdCase( "TEXT"),				// name 
-							SYSSTATEMENTS_TEXT,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"LONG VARCHAR",	// dataType
-							true,				// built-in type
-							TypeId.LONGVARCHAR_MAXWIDTH	// maxLength
-			                );
-
-		columnList[6] = 
-					new SystemColumnImpl(		
-							convertIdCase( "LASTCOMPILED"),				// name 
-							SYSSTATEMENTS_LASTCOMPILED,	// column number
-							0,							// precision
-							0,							// scale
-							true,						// nullability
-							"TIMESTAMP",				// dataType
-							true,						// built-in type
-							TypeId.TIMESTAMP_MAXWIDTH	// maxLength
-			                );
-
-		columnList[7] = new SystemColumnImpl(	
-							convertIdCase( "COMPILATIONSCHEMAID"),				// name 
-							SYSSTATEMENTS_COMPILATION_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[8] = 
-					new SystemColumnImpl(		
-							convertIdCase( "USINGTEXT"),		// name 
-							SYSSTATEMENTS_USINGTEXT,// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"LONG VARCHAR",	// dataType
-							true,				// built-in type
-							TypeId.LONGVARCHAR_MAXWIDTH	// maxLength
-			                );
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("STMTID", false),
+                SystemColumnImpl.getIdentifierColumn("STMTNAME", false),
+                SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+                SystemColumnImpl.getIndicatorColumn("TYPE"),
+                SystemColumnImpl.getColumn("VALID", Types.BOOLEAN, false),
+                SystemColumnImpl.getColumn("TEXT", Types.LONGVARCHAR, false,
+                        TypeId.LONGVARCHAR_MAXWIDTH),
+                SystemColumnImpl.getColumn("LASTCOMPILED", Types.TIMESTAMP, true),
+                SystemColumnImpl.getUUIDColumn("COMPILATIONSCHEMAID", false),
+                SystemColumnImpl.getColumn("USINGTEXT", Types.LONGVARCHAR, false,
+                        TypeId.LONGVARCHAR_MAXWIDTH),         
+            };
 		/*
 		** This column is deliberately left out.  It
 	 	** is effectively 'hidden' from users.  The code
@@ -527,8 +434,6 @@
 		//					1					// maxLength
 		//	                );
 
-
-		return	columnList;
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -44,6 +44,7 @@
 import org.apache.derby.iapi.types.*;
 
 import java.sql.Timestamp;
+import java.sql.Types;
 
 /**
  * Factory for creating a SYSSTATISTICS row.
@@ -110,7 +111,6 @@
 	/*
 	 * STATE
 	 */
-	private	SystemColumn[]		columnList;
 
 	/*
 	 *	CONSTRUCTORS
@@ -239,108 +239,16 @@
 	 */
 	public SystemColumn[] buildColumnList()
 	{
-		if (columnList != null)
-			return columnList;
-
-		columnList = new SystemColumn[SYSSTATISTICS_COLUMN_COUNT];
-		
-		columnList[0] = new SystemColumnImpl(
-						   convertIdCase( "STATID"),			// column name
-						   SYSSTATISTICS_ID,    // column number
-						   0,					// precision
-						   0,					// scale
-						   false,				// nullability
-						   "CHAR",				// dataType
-						   true,				// built-in type
-						   36					// maxLength
-						   );
-		
-		columnList[1] = new SystemColumnImpl(
-						   convertIdCase( "REFERENCEID"),			  // column name
-						   SYSSTATISTICS_REFERENCEID, // column number
-						   0,						  // precision
-						   0,						  // scale
-						   false,					  // nullability
-						   "CHAR",					  // dataType
-						   true,					  // built-in type
-						   36						  // maxLength
-						   );
-
-		columnList[2] = new SystemColumnImpl(
-						   convertIdCase( "TABLEID"),			      // column name
-						   SYSSTATISTICS_TABLEID,    // column number
-						   0,						  // precision
-						   0,						  // scale
-						   false,					  // nullability
-						   "CHAR",					  // dataType
-						   true,					  // built-in type
-						   36						  // maxLength
-						   );
-
-		columnList[3] = 
-					new SystemColumnImpl(		
-							convertIdCase( "CREATIONTIMESTAMP"),	  // name 
-							SYSSTATISTICS_TIMESTAMP,  // column number
-							0,						  // precision
-							0,						  // scale
-							false,					  // nullability
-							"TIMESTAMP",			  // dataType
-							true,					  // built-in type
-							TypeId.TIMESTAMP_MAXWIDTH // maxLength
-			                );
-
-		columnList[4] = 
-					new SystemColumnImpl(		
-							convertIdCase( "TYPE"),	  			  	  // name 
-							SYSSTATISTICS_TYPE,  	  // column number
-							0,						  // precision
-							0,						  // scale
-							false,					  // nullability
-							"CHAR",					  // dataType
-							true,					  // built-in type
-							1						  // maxLength
-			                );
-
-		columnList[5] = 
-					new SystemColumnImpl(		
-							convertIdCase( "VALID"),	  			  	  // name 
-							SYSSTATISTICS_VALID,  	  // column number
-							0,						  // precision
-							0,						  // scale
-							false,					  // nullability
-							"BOOLEAN",					  // dataType
-							true,					  // built-in type
-							1						  // maxLength
-			                );
-
-
-		columnList[6] = 
-			       new SystemColumnImpl(
-							convertIdCase( "COLCOUNT"), 				// name
-							SYSSTATISTICS_COLCOUNT,    // column number
-							0,							// precision
-							0,							// scale
-							false,						// nullability
-							"INTEGER",					// data type
-							true,						// built in type
-							4							//maxlength
-							 );
-		columnList[7] = 
-					new SystemColumnImpl(		
-							convertIdCase( "STATISTICS"),	  		  // name 
-							SYSSTATISTICS_STAT,  	  // column number
-							0,						  // precision
-							0,						  // scale
-							false,					  // nullability
-							"org.apache.derby.catalog.Statistics",  // dataType
-							false,					  // built-in type
-							12						  // maxLength
-			                );
-
-
-
-		return columnList;
-	}
-
-
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("STATID", false),
+                SystemColumnImpl.getUUIDColumn("REFERENCEID", false),
+                SystemColumnImpl.getUUIDColumn("TABLEID", false),
+                SystemColumnImpl.getColumn("CREATIONTIMESTAMP", Types.TIMESTAMP, false),
+                SystemColumnImpl.getIndicatorColumn("TYPE"),
+                SystemColumnImpl.getColumn("VALID", Types.BOOLEAN, false),
+                SystemColumnImpl.getColumn("COLCOUNT", Types.INTEGER, false),
+                SystemColumnImpl.getJavaColumn("STATISTICS",
+                        "org.apache.derby.catalog.Statistics", false)
+            };
+        }
 }	

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java?view=diff&rev=564792&r1=564791&r2=564792
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
Fri Aug 10 15:45:49 2007
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
+
 import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -261,53 +263,13 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		SystemColumn[]			columnList = new SystemColumn[SYSVIEWS_COLUMN_COUNT];
-
-		columnList[0] = new SystemColumnImpl(	
-							convertIdCase( "TABLEID"),			// name 
-							SYSVIEWS_TABLEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		// describe columns
-
-		columnList[1] = 
-					new SystemColumnImpl(	
-							convertIdCase( "VIEWDEFINITION"),		// column name
-							SYSVIEWS_VIEWDEFINITION,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"LONG VARCHAR",	    // dataType
-							true,				// built-in type
-							TypeId.LONGVARCHAR_MAXWIDTH // maxLength
-			               );
-		columnList[2] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CHECKOPTION"),		// column name
-							SYSVIEWS_CHECKOPTION,// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-		                   );
-
-		columnList[3] = new SystemColumnImpl(	
-							convertIdCase( "COMPILATIONSCHEMAID"),	// name 
-							SYSVIEWS_COMPILATION_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		return	columnList;
+            return new SystemColumn[] {
+                SystemColumnImpl.getUUIDColumn("TABLEID", false),
+                SystemColumnImpl.getColumn("VIEWDEFINITION", Types.LONGVARCHAR,
+                        false, TypeId.LONGVARCHAR_MAXWIDTH),
+                SystemColumnImpl.getIndicatorColumn("CHECKOPTION"),
+                SystemColumnImpl.getUUIDColumn("COMPILATIONSCHEMAID", true),
+                        
+            };
 	}
 }



Mime
View raw message