private void setKeyToFirstElement() {

        Column column;
        for ( int i = 0; i < columns.size(); i++ ) {
            column = columns.get( i );

            if ( column.isKey() ) {
                if ( i == 0 )
                    return;

                columns.remove( i );
                columns.add( 0, column );
                return;
            }
        }

        // if we are still here, no key was found.
        LengthColumn keyCol = new LengthColumn();
        keyCol.setColName( "KEY" );
        keyCol.setType( FieldType.LONG );
        keyCol.setFldName( "key" );
        keyCol.setKey();
        keyCol.setColLen( "10" );
        if(columns.get( 0 ).isSequenceDisabled()){
            keyCol.setSequenceDisabled();
        }

        columns.add( 0, keyCol );
    }