db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r565926 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/
Date Tue, 14 Aug 2007 21:39:00 GMT
Author: djd
Date: Tue Aug 14 14:38:59 2007
New Revision: 565926

URL: http://svn.apache.org/viewvc?view=rev&rev=565926
Log:
DERBY-1734 Change remaining implementations of CatalogRowFacotry to use the cleaner mechanism
to build system columns

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -37,10 +37,6 @@
 
 abstract class PermissionsCatalogRowFactory extends CatalogRowFactory
 {
-    static final String AUTHORIZATION_ID_TYPE = "VARCHAR";
-    static final boolean AUTHORIZATION_ID_IS_BUILTIN_TYPE = true;
-    static final int AUTHORIZATION_ID_LENGTH = Limits.MAX_IDENTIFIER_LENGTH;
-
     PermissionsCatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory
dvf,
                                         boolean convertIdToLower)
     {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -90,8 +90,6 @@
 		,"80220011-010c-bc85-060d-000000109ab8" //index3
     };
 
-    private SystemColumn[] columnList;
-
     SYSCOLPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
                                  boolean convertIdToLower)
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
 import java.util.Properties;
 
 import org.apache.derby.catalog.TypeDescriptor;
@@ -61,11 +62,6 @@
 {
 	static final String		TABLENAME_STRING = "SYSCOLUMNS";
 
-	/**
-	 * Old name for REFERENCEID, used by upgrade
-	 */
-	public static final String		OLD_REFERENCEID_NAME = "TABLEID";
-
 	protected static final int		SYSCOLUMNS_COLUMN_COUNT = 9;
 	/* Column #s for syscolumns (1 based) */
 
@@ -88,10 +84,6 @@
 	//private static final String	SYSCOLUMNS_INDEX2_NAME = "SYSCOLUMNS_INDEX2";
 	protected static final int		SYSCOLUMNS_INDEX2_ID = 1;
 
-	protected	static	final	String	REFERENCEDID_STRING = "REFERENCEID";
-	protected	static	final	String	COLUMNNAME_STRING = "COLUMNNAME";
-	protected	static	final	String	COLUMNDEFAULTID_STRING = "COLUMNDEFAULTID";
-
     private	static	final	boolean[]	uniqueness = {
 		                                               true,
 													   false
@@ -117,8 +109,6 @@
 	//
 	/////////////////////////////////////////////////////////////////////////////
 
-	private	SystemColumn[]		columnList;
-
 	/////////////////////////////////////////////////////////////////////////////
 	//
 	//	CONSTRUCTORS
@@ -443,116 +433,21 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		if ( columnList != null ) { return columnList; }
-
-		columnList = new SystemColumn[SYSCOLUMNS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[0] = 
-					new SystemColumnImpl(
-								convertIdCase( REFERENCEDID_STRING),			// column name
-								SYSCOLUMNS_REFERENCEID,// column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		columnList[1] = 
-					new SystemColumnImpl(			// SQL IDENTIFIER
-								convertIdCase( COLUMNNAME_STRING),		// column name
-								SYSCOLUMNS_COLUMNNAME,	// column number
-								false				// nullability
-			                   );
-
-		columnList[2] = 
-					new SystemColumnImpl(
-								convertIdCase( "COLUMNNUMBER"),	// column name
-								SYSCOLUMNS_COLUMNNUMBER,	// column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"INTEGER",				// dataType
-								true,				// built-in type
-								4					// maxLength
-							   );
-
-		columnList[3] = 
-					new SystemColumnImpl(	
-							convertIdCase( "COLUMNDATATYPE"),			// column name
-							SYSCOLUMNS_COLUMNDATATYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"org.apache.derby.catalog.TypeDescriptor",	    // dataType
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-			               );
-
-		columnList[4] = 
-					new SystemColumnImpl(	
-							convertIdCase( "COLUMNDEFAULT"),			// column name
-							SYSCOLUMNS_COLUMNDEFAULT,	// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"java.io.Serializable",	    // dataType
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-			               );
-
-		columnList[5] = 
-					new SystemColumnImpl(
-								convertIdCase( COLUMNDEFAULTID_STRING),			// column name
-								SYSCOLUMNS_COLUMNDEFAULTID,// column number
-								0,					// precision
-								0,					// scale
-								true,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		// new columns for autoincrement.
-		columnList[6] = 
-			        new SystemColumnImpl(
-							    convertIdCase( "AUTOINCREMENTVALUE"), // column name
-								SYSCOLUMNS_AUTOINCREMENTVALUE,
-								0,
-								0, 
-								true,
-								"BIGINT",
-								true,
-								TypeId.LONGINT_MAXWIDTH
-							   );
-		
-		columnList[7] = 
-			        new SystemColumnImpl(
-							    convertIdCase( "AUTOINCREMENTSTART"), // column name
-								SYSCOLUMNS_AUTOINCREMENTSTART,
-								0,
-								0, 
-								true,
-								"BIGINT",
-								true,
-								TypeId.LONGINT_MAXWIDTH
-							   );
-
-		columnList[8] = 
-			        new SystemColumnImpl(
-							    convertIdCase( "AUTOINCREMENTINC"), // column name
-								SYSCOLUMNS_AUTOINCREMENTINC,
-								0,
-								0, 
-								true,
-								"BIGINT",
-								true,
-								TypeId.LONGINT_MAXWIDTH
-							   );
+        
+        return new SystemColumn[] {
+            SystemColumnImpl.getUUIDColumn("REFERENCEID", false),
+            SystemColumnImpl.getIdentifierColumn("COLUMNNAME", false),
+            SystemColumnImpl.getColumn("COLUMNNUMBER", Types.INTEGER, false),
+            SystemColumnImpl.getJavaColumn("COLUMNDATATYPE",
+                "org.apache.derby.catalog.TypeDescriptor", false),
+            SystemColumnImpl.getJavaColumn("COLUMNDEFAULT",
+                "java.io.Serializable", true),
+            SystemColumnImpl.getUUIDColumn("COLUMNDEFAULTID", true),
+            
+            SystemColumnImpl.getColumn("AUTOINCREMENTVALUE", Types.BIGINT, true),
+            SystemColumnImpl.getColumn("AUTOINCREMENTSTART", Types.BIGINT, true),
+            SystemColumnImpl.getColumn("AUTOINCREMENTINC", Types.BIGINT, true),
 
-		return	columnList;
+       };
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.iapi.sql.dictionary.SystemColumn;
 import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;
 import org.apache.derby.iapi.sql.dictionary.RoutinePermsDescriptor;
@@ -80,8 +81,6 @@
 		,"08264012-010c-bc85-060d-000000109ab8" // index3
     };
 
-    private SystemColumn[] columnList;
-
     public SYSROUTINEPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory
dvf,
                                      boolean convertIdToLower)
 	{
@@ -153,58 +152,14 @@
 	/** builds a column list for the catalog */
 	public SystemColumn[] buildColumnList()
     {
-		if (columnList == null)
-        {
-            columnList = new SystemColumn[ COLUMN_COUNT];
-
-            columnList[ ROUTINEPERMSID_COL_NUM - 1] =
-                new SystemColumnImpl( convertIdCase( "ROUTINEPERMSID"),
-                                      ROUTINEPERMSID_COL_NUM,
-                                      0, // precision
-                                      0, // scale
-                                      false, // nullability
-                                      "CHAR",
-                                      true,
-                                      36);
-            columnList[ GRANTEE_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTEE"),
-                                    GRANTEE_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ GRANTOR_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTOR"),
-                                    GRANTOR_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ ALIASID_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "ALIASID"),
-                                    ALIASID_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    36);
-            columnList[ GRANTOPTION_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTOPTION"),
-                                    GRANTOPTION_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-        }
-		return columnList;
-    } // end of buildColumnList
+         return new SystemColumn[] {
+             SystemColumnImpl.getUUIDColumn("ROUTINEPERMSID", false),
+             SystemColumnImpl.getIdentifierColumn("GRANTEE", false),
+             SystemColumnImpl.getIdentifierColumn("GRANTOR", false),
+             SystemColumnImpl.getUUIDColumn("ALIASID", false),
+             SystemColumnImpl.getIndicatorColumn("GRANTOPTION")
+         };
+    }
 
 	/**
 	 * builds an index key row given for a given index number.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -84,8 +84,6 @@
 		,"f81e0010-010c-bc85-060d-000000109ab8"	// index3
     };
 
-    private SystemColumn[] columnList;
-
     public SYSTABLEPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory
dvf,
                                    boolean convertIdToLower)
 	{
@@ -198,103 +196,19 @@
 	/** builds a column list for the catalog */
 	public SystemColumn[] buildColumnList()
     {
-		if (columnList == null)
-        {
-            columnList = new SystemColumn[ COLUMN_COUNT];
-
-            columnList[ TABLEPERMSID_COL_NUM - 1] =
-                new SystemColumnImpl( convertIdCase( "TABLEPERMSID"),
-                                      TABLEPERMSID_COL_NUM,
-                                      0, // precision
-                                      0, // scale
-                                      false, // nullability
-                                      "CHAR",
-                                      true,
-                                      36);
-            columnList[ GRANTEE_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTEE"),
-                                    GRANTEE_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ GRANTOR_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTOR"),
-                                    GRANTOR_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ TABLEID_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "TABLEID"),
-                                    TABLEID_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    36);
-            columnList[ SELECTPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "SELECTPRIV"),
-                                    SELECTPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ DELETEPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "DELETEPRIV"),
-                                    DELETEPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ INSERTPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "INSERTPRIV"),
-                                    INSERTPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ UPDATEPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "UPDATEPRIV"),
-                                    UPDATEPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ REFERENCESPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "REFERENCESPRIV"),
-                                    REFERENCESPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ TRIGGERPRIV_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "TRIGGERPRIV"),
-                                    TRIGGERPRIV_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-        }
-		return columnList;
-    } // end of buildColumnList
+        return new SystemColumn[] {
+            SystemColumnImpl.getUUIDColumn("TABLEPERMSID", false),
+            SystemColumnImpl.getIdentifierColumn("GRANTEE", false),
+            SystemColumnImpl.getIdentifierColumn("GRANTOR", false),
+            SystemColumnImpl.getUUIDColumn("TABLEID", false),
+            SystemColumnImpl.getIndicatorColumn("SELECTPRIV"),
+            SystemColumnImpl.getIndicatorColumn("DELETEPRIV"),
+            SystemColumnImpl.getIndicatorColumn("INSERTPRIV"),
+            SystemColumnImpl.getIndicatorColumn("UPDATEPRIV"),
+            SystemColumnImpl.getIndicatorColumn("REFERENCESPRIV"),
+            SystemColumnImpl.getIndicatorColumn("TRIGGERPRIV"),
+        };
+    }
 
 	/**
 	 * builds a key row given for a given index number.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -382,61 +382,13 @@
 	 */
 	public SystemColumn[]	buildColumnList()
 	{
-		SystemColumn[]			columnList = new SystemColumn[SYSTABLES_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[0] = new SystemColumnImpl(	
-								convertIdCase( "TABLEID"),			// column name
-								SYSTABLES_TABLEID,	// column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		columnList[1] = new SystemColumnImpl(		// SQLIDENTIFIER
-								convertIdCase( "TABLENAME"),		// column name
-								SYSTABLES_TABLENAME, 	// column number
-								false				// nullability
-			                   );
-
-		columnList[2] = new SystemColumnImpl(	
-								convertIdCase( "TABLETYPE"),		// column name
-								SYSTABLES_TABLETYPE,// column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								1					// maxLength
-			                   );
-
-		columnList[3] = new SystemColumnImpl(	
-								convertIdCase( "SCHEMAID"),			// column name
-								SYSTABLES_SCHEMAID,	// schema number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		columnList[4] = new SystemColumnImpl(	
-								convertIdCase( "LOCKGRANULARITY"),		// column name
-								SYSTABLES_LOCKGRANULARITY,// column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								1					// maxLength
-			                   );
-
-		return	columnList;
+        return new SystemColumn[] {
+            SystemColumnImpl.getUUIDColumn("TABLEID", false),
+            SystemColumnImpl.getIdentifierColumn("TABLENAME", false),
+            SystemColumnImpl.getIndicatorColumn("TABLETYPE"),
+            SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+            SystemColumnImpl.getIndicatorColumn("LOCKGRANULARITY"),
+        };
 	}
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java?view=diff&rev=565926&r1=565925&r2=565926
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
Tue Aug 14 14:38:59 2007
@@ -54,6 +54,7 @@
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.types.SQLTimestamp;
 import java.sql.Timestamp;
+import java.sql.Types;
 
 /**
  * Factory for creating a SYSTRIGGERS row.
@@ -432,197 +433,28 @@
 	 */
 	public SystemColumn[] buildColumnList()
 	{
-		SystemColumn[]	columnList = new SystemColumn[SYSTRIGGERS_COLUMN_COUNT];
-
-		// describe columns
-		columnList[SYSTRIGGERS_TRIGGERID-1] = new SystemColumnImpl(	
-							convertIdCase( "TRIGGERID"),			// name 
-							SYSTRIGGERS_TRIGGERID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_TRIGGERNAME-1] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "TRIGGERNAME"),			// column name
-							SYSTRIGGERS_TRIGGERNAME,	// column number
-							false				// nullability
-							);
-
-		columnList[SYSTRIGGERS_SCHEMAID-1] = new SystemColumnImpl(	
-							convertIdCase( "SCHEMAID"),				// name 
-							SYSTRIGGERS_SCHEMAID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_CREATIONTIMESTAMP-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "CREATIONTIMESTAMP"),		// name 
-							SYSTRIGGERS_CREATIONTIMESTAMP,	// column number
-							0,							// precision
-							0,							// scale
-							false,						// nullability
-							"TIMESTAMP",				// dataType
-							true,						// built-in type
-							TypeId.TIMESTAMP_MAXWIDTH	// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_EVENT-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "EVENT"),			// name 
-							SYSTRIGGERS_EVENT,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_FIRINGTIME-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "FIRINGTIME"),		// name 
-							SYSTRIGGERS_FIRINGTIME, // column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_TYPE-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "TYPE"),				// name 
-							SYSTRIGGERS_TYPE,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_STATE-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "STATE"),			// name 
-							SYSTRIGGERS_STATE,// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_TABLEID-1] = 
-					new SystemColumnImpl(	
-							convertIdCase( "TABLEID"),			// name 
-							SYSTRIGGERS_TABLEID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_WHENSTMTID-1] = 
-					new SystemColumnImpl(	
-							convertIdCase( "WHENSTMTID"),				// name 
-							SYSTRIGGERS_WHENSTMTID,		// column number
-							0,							// precision
-							0,							// scale
-							true,						// nullability
-							"CHAR",						// dataType
-							true,						// built-in type
-							36							// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_ACTIONSTMTID-1] = 
-					new SystemColumnImpl(	
-							convertIdCase( "ACTIONSTMTID"),				// name 
-							SYSTRIGGERS_ACTIONSTMTID,	// column number
-							0,							// precision
-							0,							// scale
-							true,						// nullability
-							"CHAR",						// dataType
-							true,						// built-in type
-							36							// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_REFERENCEDCOLUMNS-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "REFERENCEDCOLUMNS"),			// name 
-							SYSTRIGGERS_REFERENCEDCOLUMNS,	// column number
-							0,								// precision
-							0,								// scale
-							true,							// nullability
-							"org.apache.derby.catalog.ReferencedColumns",	//datatype
-							false,							// built-in type
-							DataTypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-			                );
-
-		columnList[SYSTRIGGERS_TRIGGERDEFINITION-1] = 
-					new SystemColumnImpl(	
-							convertIdCase( "TRIGGERDEFINITION"),				// name 
-							SYSTRIGGERS_TRIGGERDEFINITION,	// column number
-							0,							// precision
-							0,							// scale
-							true,						// nullability
-							"LONG VARCHAR",			// dataType
-							true,				// built-in type
-							Integer.MAX_VALUE	// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_REFERENCINGOLD-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "REFERENCINGOLD"),			// name 
-							SYSTRIGGERS_REFERENCINGOLD,// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"BOOLEAN",			// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_REFERENCINGNEW-1] = 
-					new SystemColumnImpl(		
-							convertIdCase( "REFERENCINGNEW"),			// name 
-							SYSTRIGGERS_REFERENCINGNEW,// column number
-							0,					// precision
-							0,					// scale
-							true,				// nullability
-							"BOOLEAN",			// dataType
-							true,				// built-in type
-							1					// maxLength
-			                );
-
-		columnList[SYSTRIGGERS_OLDREFERENCINGNAME-1] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "OLDREFERENCINGNAME"),			// column name
-							SYSTRIGGERS_OLDREFERENCINGNAME,	// column number
-							true				// nullability
-							);
-
-		columnList[SYSTRIGGERS_NEWREFERENCINGNAME-1] = 
-					new SystemColumnImpl(		// SQL IDENTIFIER
-							convertIdCase( "NEWREFERENCINGNAME"),			// column name
-							SYSTRIGGERS_NEWREFERENCINGNAME,	// column number
-							true				// nullability
-							);
-
-		return	columnList;
+        return new SystemColumn[] {
+            SystemColumnImpl.getUUIDColumn("TRIGGERID", false),
+            SystemColumnImpl.getIdentifierColumn("TRIGGERNAME", false),
+            SystemColumnImpl.getUUIDColumn("SCHEMAID", false),
+            SystemColumnImpl.getColumn("CREATIONTIMESTAMP", Types.TIMESTAMP, false),
+            SystemColumnImpl.getIndicatorColumn("EVENT"),
+            SystemColumnImpl.getIndicatorColumn("FIRINGTIME"),
+            SystemColumnImpl.getIndicatorColumn("TYPE"),
+            SystemColumnImpl.getIndicatorColumn("STATE"),
+            SystemColumnImpl.getUUIDColumn("TABLEID", false),
+            SystemColumnImpl.getUUIDColumn("WHENSTMTID", true),
+            SystemColumnImpl.getUUIDColumn("ACTIONSTMTID", true),
+            SystemColumnImpl.getJavaColumn("REFERENCEDCOLUMNS",
+                    "org.apache.derby.catalog.ReferencedColumns", true),
+            SystemColumnImpl.getColumn("TRIGGERDEFINITION",
+                    Types.LONGVARCHAR, true, Integer.MAX_VALUE),
+            SystemColumnImpl.getColumn("REFERENCINGOLD", Types.BOOLEAN, true),
+            SystemColumnImpl.getColumn("REFERENCINGNEW", Types.BOOLEAN, true),
+            SystemColumnImpl.getIdentifierColumn("OLDREFERENCINGNAME", true),
+            SystemColumnImpl.getIdentifierColumn("NEWREFERENCINGNAME", true),
+            
+           };
 	}
 
 	// a little helper



Mime
View raw message