StoredProcedureImpl extends AbstractProcedureImpl implements StoredProcedure { @Override public void setNativeQuery( final UnitOfWork transaction, final String newNativeQuery ) throws KException { setStatementOption( transaction, StandardOption.NATIVE_QUERY.getName(), newNativeQuery ); } StoredProcedureImpl( final UnitOfWork uow,
                                final Repository repository,
                                final String workspacePath ); @Override KomodoType[] getChildTypes(); @Override String getNativeQuery( final UnitOfWork transaction ); @Override ProcedureResultSet getResultSet( final UnitOfWork transaction ); @Override Map< String, String > getStandardOptions(); @Override KomodoType getTypeIdentifier( final UnitOfWork transaction ); @Override Model getParent( final UnitOfWork transaction ); @Override boolean isNonPrepared( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override void removeResultSet( final UnitOfWork transaction ); @Override void setNativeQuery( final UnitOfWork transaction,
                                final String newNativeQuery ); @Override void setNonPrepared( final UnitOfWork transaction,
                                final boolean newNonPrepared ); @SuppressWarnings( "unchecked" ) @Override T setResultSet( final UnitOfWork transaction,
                                                            final Class< T > resultSetType );  }
@Test( expected = KException.class ) public void shouldFailSettingNativeQueryWithEmptyValueWhenItWasNeverAdded() throws Exception { this.procedure.setNativeQuery( getTransaction(), StringConstants.EMPTY_STRING ); }
@Test( expected = KException.class ) public void shouldFailSettingNullNativeQueryWhenNeverAdded() throws Exception { this.procedure.setNativeQuery( getTransaction(), null ); }
@Test public void shouldNotCountStatementOptionsAsChildren() throws Exception { this.procedure.setNativeQuery( getTransaction(), "blah" ); this.procedure.setStatementOption( getTransaction(), "sledge", "hammer" ); assertThat( this.procedure.getChildren( getTransaction() ).length, is( 0 ) ); }