@Test( expected = IllegalArgumentException.class ) public void shouldFailTryingToRemoveNullColumnName() throws Exception { this.table.removeColumn( getTransaction(), null ); }
@Override public void removeColumn( final UnitOfWork transaction, final String columnToRemove ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotEmpty( columnToRemove, "columnToRemove" ); final Column[] columns = getColumns( transaction, columnToRemove ); if ( columns.length == 0 ) { throw new KException( Messages.getString( Relational.COLUMN_NOT_FOUND_TO_REMOVE, columnToRemove ) ); } columns[ 0 ].remove( transaction ); }
TableImpl extends RelationalObjectImpl implements Table { @Override public void removeColumn( final UnitOfWork transaction, final String columnToRemove ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotEmpty( columnToRemove, "columnToRemove" ); final Column[] columns = getColumns( transaction, columnToRemove ); if ( columns.length == 0 ) { throw new KException( Messages.getString( Relational.COLUMN_NOT_FOUND_TO_REMOVE, columnToRemove ) ); } columns[ 0 ].remove( transaction ); } }
TableImpl extends RelationalObjectImpl implements Table { @Override public void removeColumn( final UnitOfWork transaction, final String columnToRemove ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotEmpty( columnToRemove, "columnToRemove" ); final Column[] columns = getColumns( transaction, columnToRemove ); if ( columns.length == 0 ) { throw new KException( Messages.getString( Relational.COLUMN_NOT_FOUND_TO_REMOVE, columnToRemove ) ); } columns[ 0 ].remove( transaction ); } TableImpl( final UnitOfWork uow,
                      final Repository repository,
                      final String workspacePath ); }
TableImpl extends RelationalObjectImpl implements Table { @Override public void removeColumn( final UnitOfWork transaction, final String columnToRemove ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotEmpty( columnToRemove, "columnToRemove" ); final Column[] columns = getColumns( transaction, columnToRemove ); if ( columns.length == 0 ) { throw new KException( Messages.getString( Relational.COLUMN_NOT_FOUND_TO_REMOVE, columnToRemove ) ); } columns[ 0 ].remove( transaction ); } TableImpl( final UnitOfWork uow,
                      final Repository repository,
                      final String workspacePath ); @Override AccessPattern addAccessPattern( final UnitOfWork transaction,
                                           final String accessPatternName ); @Override Column addColumn( final UnitOfWork transaction,
                             final String columnName ); @Override ForeignKey addForeignKey( final UnitOfWork transaction,
                                     final String foreignKeyName,
                                     final Table referencedTable ); @Override Index addIndex( final UnitOfWork transaction,
                           final String indexName ); @Override UniqueConstraint addUniqueConstraint( final UnitOfWork transaction,
                                                 final String constraintName ); @Override AccessPattern[] getAccessPatterns( final UnitOfWork transaction,
                                              final String... namePatterns ); @Override long getCardinality( final UnitOfWork transaction ); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoType[] getChildTypes(); @Override Column[] getColumns( final UnitOfWork transaction,
                                final String... namePatterns ); @Override StatementOption[] getCustomOptions( final UnitOfWork transaction ); @Override String getDescription( final UnitOfWork transaction ); @Override ForeignKey[] getForeignKeys( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override Index[] getIndexes( final UnitOfWork transaction,
                               final String... namePatterns ); @Override String getMaterializedTable( final UnitOfWork transaction ); @Override String getNameInSource( final UnitOfWork transaction ); @Override OnCommit getOnCommitValue( final UnitOfWork uow ); @Override PrimaryKey getPrimaryKey( final UnitOfWork transaction ); @Override Descriptor getPrimaryType( final UnitOfWork transaction ); @Override Property getProperty( final UnitOfWork transaction,
                                 final String name ); @Override PropertyDescriptor getPropertyDescriptor( final UnitOfWork transaction,
                                                     final String propName ); @Override String[] getPropertyNames( final UnitOfWork transaction ); @Override String getQueryExpression( final UnitOfWork uow ); @Override SchemaElementType getSchemaElementType( final UnitOfWork uow ); @Override Map< String, String > getStandardOptions(); @Override String[] getStatementOptionNames( final UnitOfWork transaction ); @Override StatementOption[] getStatementOptions( final UnitOfWork transaction ); @Override TemporaryType getTemporaryTableType( final UnitOfWork uow ); @Override int getTypeId(); @Override KomodoType getTypeIdentifier( final UnitOfWork uow ); @Override UniqueConstraint[] getUniqueConstraints( final UnitOfWork transaction,
                                                    final String... namePatterns ); @Override String getUuid( final UnitOfWork transaction ); @Override Model getParent( final UnitOfWork transaction ); @Override boolean hasProperties( final UnitOfWork transaction ); @Override boolean hasProperty( final UnitOfWork transaction,
                                final String name ); @Override boolean isCustomOption( final UnitOfWork transaction,
                                   final String name ); @Override boolean isMaterialized( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override boolean isUpdatable( final UnitOfWork transaction ); @Override void removeAccessPattern( final UnitOfWork transaction,
                                     final String accessPatternToRemove ); @Override void removeColumn( final UnitOfWork transaction,
                              final String columnToRemove ); @Override void removeForeignKey( final UnitOfWork transaction,
                                  final String foreignKeyToRemove ); @Override void removeIndex( final UnitOfWork transaction,
                             final String indexToRemove ); @Override void removePrimaryKey( final UnitOfWork transaction ); @Override void removeStatementOption( final UnitOfWork transaction,
                                       final String optionToRemove ); @Override void removeUniqueConstraint( final UnitOfWork transaction,
                                        final String constraintToRemove ); @Override void setCardinality( final UnitOfWork transaction,
                                final long newCardinality ); @Override void setDescription( final UnitOfWork transaction,
                                final String newDescription ); @Override void setMaterialized( final UnitOfWork transaction,
                                 final boolean newMaterialized ); @Override void setMaterializedTable( final UnitOfWork transaction,
                                      final String newMaterializedTable ); @Override void setNameInSource( final UnitOfWork transaction,
                                 final String newNameInSource ); @Override void setOnCommitValue( final UnitOfWork uow,
                                  final OnCommit newOnCommit ); @Override PrimaryKey setPrimaryKey( final UnitOfWork transaction,
                                     final String newPrimaryKeyName ); @Override void setProperty( final UnitOfWork transaction,
                             final String propertyName,
                             final Object... values ); @Override void setQueryExpression( final UnitOfWork uow,
                                    final String newQueryExpression ); @Override void setSchemaElementType( final UnitOfWork uow,
                                      final SchemaElementType newSchemaElementType ); @Override StatementOption setStatementOption( final UnitOfWork transaction,
                                               final String optionName,
                                               final String optionValue ); @Override void setTemporaryTableType( final UnitOfWork uow,
                                       final TemporaryType newTempType ); @Override void setUpdatable( final UnitOfWork transaction,
                              final boolean newUpdatable ); @Override void setUuid( final UnitOfWork transaction,
                         final String newUuid ); @Override byte[] export( final UnitOfWork transaction , Properties exportProperties); @Override DocumentType getDocumentType(UnitOfWork transaction); }
TableImpl extends RelationalObjectImpl implements Table { @Override public void removeColumn( final UnitOfWork transaction, final String columnToRemove ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotEmpty( columnToRemove, "columnToRemove" ); final Column[] columns = getColumns( transaction, columnToRemove ); if ( columns.length == 0 ) { throw new KException( Messages.getString( Relational.COLUMN_NOT_FOUND_TO_REMOVE, columnToRemove ) ); } columns[ 0 ].remove( transaction ); } TableImpl( final UnitOfWork uow,
                      final Repository repository,
                      final String workspacePath ); @Override AccessPattern addAccessPattern( final UnitOfWork transaction,
                                           final String accessPatternName ); @Override Column addColumn( final UnitOfWork transaction,
                             final String columnName ); @Override ForeignKey addForeignKey( final UnitOfWork transaction,
                                     final String foreignKeyName,
                                     final Table referencedTable ); @Override Index addIndex( final UnitOfWork transaction,
                           final String indexName ); @Override UniqueConstraint addUniqueConstraint( final UnitOfWork transaction,
                                                 final String constraintName ); @Override AccessPattern[] getAccessPatterns( final UnitOfWork transaction,
                                              final String... namePatterns ); @Override long getCardinality( final UnitOfWork transaction ); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoType[] getChildTypes(); @Override Column[] getColumns( final UnitOfWork transaction,
                                final String... namePatterns ); @Override StatementOption[] getCustomOptions( final UnitOfWork transaction ); @Override String getDescription( final UnitOfWork transaction ); @Override ForeignKey[] getForeignKeys( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override Index[] getIndexes( final UnitOfWork transaction,
                               final String... namePatterns ); @Override String getMaterializedTable( final UnitOfWork transaction ); @Override String getNameInSource( final UnitOfWork transaction ); @Override OnCommit getOnCommitValue( final UnitOfWork uow ); @Override PrimaryKey getPrimaryKey( final UnitOfWork transaction ); @Override Descriptor getPrimaryType( final UnitOfWork transaction ); @Override Property getProperty( final UnitOfWork transaction,
                                 final String name ); @Override PropertyDescriptor getPropertyDescriptor( final UnitOfWork transaction,
                                                     final String propName ); @Override String[] getPropertyNames( final UnitOfWork transaction ); @Override String getQueryExpression( final UnitOfWork uow ); @Override SchemaElementType getSchemaElementType( final UnitOfWork uow ); @Override Map< String, String > getStandardOptions(); @Override String[] getStatementOptionNames( final UnitOfWork transaction ); @Override StatementOption[] getStatementOptions( final UnitOfWork transaction ); @Override TemporaryType getTemporaryTableType( final UnitOfWork uow ); @Override int getTypeId(); @Override KomodoType getTypeIdentifier( final UnitOfWork uow ); @Override UniqueConstraint[] getUniqueConstraints( final UnitOfWork transaction,
                                                    final String... namePatterns ); @Override String getUuid( final UnitOfWork transaction ); @Override Model getParent( final UnitOfWork transaction ); @Override boolean hasProperties( final UnitOfWork transaction ); @Override boolean hasProperty( final UnitOfWork transaction,
                                final String name ); @Override boolean isCustomOption( final UnitOfWork transaction,
                                   final String name ); @Override boolean isMaterialized( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override boolean isUpdatable( final UnitOfWork transaction ); @Override void removeAccessPattern( final UnitOfWork transaction,
                                     final String accessPatternToRemove ); @Override void removeColumn( final UnitOfWork transaction,
                              final String columnToRemove ); @Override void removeForeignKey( final UnitOfWork transaction,
                                  final String foreignKeyToRemove ); @Override void removeIndex( final UnitOfWork transaction,
                             final String indexToRemove ); @Override void removePrimaryKey( final UnitOfWork transaction ); @Override void removeStatementOption( final UnitOfWork transaction,
                                       final String optionToRemove ); @Override void removeUniqueConstraint( final UnitOfWork transaction,
                                        final String constraintToRemove ); @Override void setCardinality( final UnitOfWork transaction,
                                final long newCardinality ); @Override void setDescription( final UnitOfWork transaction,
                                final String newDescription ); @Override void setMaterialized( final UnitOfWork transaction,
                                 final boolean newMaterialized ); @Override void setMaterializedTable( final UnitOfWork transaction,
                                      final String newMaterializedTable ); @Override void setNameInSource( final UnitOfWork transaction,
                                 final String newNameInSource ); @Override void setOnCommitValue( final UnitOfWork uow,
                                  final OnCommit newOnCommit ); @Override PrimaryKey setPrimaryKey( final UnitOfWork transaction,
                                     final String newPrimaryKeyName ); @Override void setProperty( final UnitOfWork transaction,
                             final String propertyName,
                             final Object... values ); @Override void setQueryExpression( final UnitOfWork uow,
                                    final String newQueryExpression ); @Override void setSchemaElementType( final UnitOfWork uow,
                                      final SchemaElementType newSchemaElementType ); @Override StatementOption setStatementOption( final UnitOfWork transaction,
                                               final String optionName,
                                               final String optionValue ); @Override void setTemporaryTableType( final UnitOfWork uow,
                                       final TemporaryType newTempType ); @Override void setUpdatable( final UnitOfWork transaction,
                              final boolean newUpdatable ); @Override void setUuid( final UnitOfWork transaction,
                         final String newUuid ); @Override byte[] export( final UnitOfWork transaction , Properties exportProperties); @Override DocumentType getDocumentType(UnitOfWork transaction);  }