@Test( expected = IllegalArgumentException.class ) public void shouldNotAllowNullTableReference() throws Exception { this.foreignKey.setReferencesTable( getTransaction(), null ); }
@Override public void setReferencesTable( final UnitOfWork transaction, final Table newReferencesTable ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotNull( newReferencesTable, "newReferencesTable" ); final Table current = getReferencesTable( transaction ); if ( !newReferencesTable.equals( current ) ) { final String tableId = newReferencesTable.getRawProperty( transaction, JcrLexicon.UUID.getString() ).getStringValue( transaction ); setProperty( transaction, Constraint.TABLE_REFERENCE, tableId ); if ( ( current != null ) && hasProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES ) ) { setProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES, ( Object[] )null ); } } }
ForeignKeyImpl extends TableConstraintImpl implements ForeignKey { @Override public void setReferencesTable( final UnitOfWork transaction, final Table newReferencesTable ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotNull( newReferencesTable, "newReferencesTable" ); final Table current = getReferencesTable( transaction ); if ( !newReferencesTable.equals( current ) ) { final String tableId = newReferencesTable.getRawProperty( transaction, JcrLexicon.UUID.getString() ).getStringValue( transaction ); setProperty( transaction, Constraint.TABLE_REFERENCE, tableId ); if ( ( current != null ) && hasProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES ) ) { setProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES, ( Object[] )null ); } } } }
ForeignKeyImpl extends TableConstraintImpl implements ForeignKey { @Override public void setReferencesTable( final UnitOfWork transaction, final Table newReferencesTable ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotNull( newReferencesTable, "newReferencesTable" ); final Table current = getReferencesTable( transaction ); if ( !newReferencesTable.equals( current ) ) { final String tableId = newReferencesTable.getRawProperty( transaction, JcrLexicon.UUID.getString() ).getStringValue( transaction ); setProperty( transaction, Constraint.TABLE_REFERENCE, tableId ); if ( ( current != null ) && hasProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES ) ) { setProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES, ( Object[] )null ); } } } ForeignKeyImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); }
ForeignKeyImpl extends TableConstraintImpl implements ForeignKey { @Override public void setReferencesTable( final UnitOfWork transaction, final Table newReferencesTable ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotNull( newReferencesTable, "newReferencesTable" ); final Table current = getReferencesTable( transaction ); if ( !newReferencesTable.equals( current ) ) { final String tableId = newReferencesTable.getRawProperty( transaction, JcrLexicon.UUID.getString() ).getStringValue( transaction ); setProperty( transaction, Constraint.TABLE_REFERENCE, tableId ); if ( ( current != null ) && hasProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES ) ) { setProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES, ( Object[] )null ); } } } ForeignKeyImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override void addReferencesColumn( final UnitOfWork transaction,
                                     final Column newReferencesColumn ); @Override ConstraintType getConstraintType(); @Override Column[] getReferencesColumns( final UnitOfWork transaction ); @Override Table getReferencesTable( final UnitOfWork transaction ); @Override int getTypeId(); @Override Table getParent( final UnitOfWork transaction ); @Override void removeReferencesColumn( final UnitOfWork transaction,
                                        final Column removeReferencesColumn ); @Override void setReferencesTable( final UnitOfWork transaction,
                                    final Table newReferencesTable ); }
ForeignKeyImpl extends TableConstraintImpl implements ForeignKey { @Override public void setReferencesTable( final UnitOfWork transaction, final Table newReferencesTable ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); ArgCheck.isNotNull( newReferencesTable, "newReferencesTable" ); final Table current = getReferencesTable( transaction ); if ( !newReferencesTable.equals( current ) ) { final String tableId = newReferencesTable.getRawProperty( transaction, JcrLexicon.UUID.getString() ).getStringValue( transaction ); setProperty( transaction, Constraint.TABLE_REFERENCE, tableId ); if ( ( current != null ) && hasProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES ) ) { setProperty( transaction, Constraint.TABLE_REFERENCE_REFERENCES, ( Object[] )null ); } } } ForeignKeyImpl( final UnitOfWork uow,
                           final Repository repository,
                           final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override void addReferencesColumn( final UnitOfWork transaction,
                                     final Column newReferencesColumn ); @Override ConstraintType getConstraintType(); @Override Column[] getReferencesColumns( final UnitOfWork transaction ); @Override Table getReferencesTable( final UnitOfWork transaction ); @Override int getTypeId(); @Override Table getParent( final UnitOfWork transaction ); @Override void removeReferencesColumn( final UnitOfWork transaction,
                                        final Column removeReferencesColumn ); @Override void setReferencesTable( final UnitOfWork transaction,
                                    final Table newReferencesTable );  }