public void createPrimaryKey ( HsqlName indexName , int [ ] columns , boolean columnsNotNull ) { if ( primaryKeyCols != null ) { throw Error . runtimeError ( ErrorCode . U_S0500 , "Table" ) ; } if ( columns == null ) { columns = ValuePool . emptyIntArray ; } else { for ( int i = 0 ; i < columns . length ; i ++ ) { getColumn ( columns [ i ] ) . setPrimaryKey ( true ) ; } } primaryKeyCols = columns ; setColumnStructures ( ) ; primaryKeyTypes = new Type [ primaryKeyCols . length ] ; ArrayUtil . projectRow ( colTypes , primaryKeyCols , primaryKeyTypes ) ; primaryKeyColsSequence = new int [ primaryKeyCols . length ] ; ArrayUtil . fillSequence ( primaryKeyColsSequence ) ; HsqlName name = indexName ; if ( name == null ) { name = database . nameManager . newAutoName ( "IDX" , getSchemaName ( ) , getName ( ) , SchemaObject . INDEX ) ; } createPrimaryIndex ( primaryKeyCols , primaryKeyTypes , name ) ; setBestRowIdentifiers ( ) ; }
Creates a single or multi - column primary key and index . sets the colTypes array . Finalises the creation of the table . ( fredt