@Test public void shouldSetStandardOptionAsIfProperty() throws Exception { final String option = this.procedure.getStandardOptions().keySet().iterator().next(); this.procedure.setStatementOption( getTransaction(), option, "initialValue" ); final String value = "newValue"; this.procedure.setProperty( getTransaction(), option, value ); assertThat( this.procedure.hasProperty( getTransaction(), option ), is( true ) ); assertThat( this.procedure.getProperty( getTransaction(), option ), is( instanceOf( StatementOption.class ) ) ); assertThat( this.procedure.isCustomOption( getTransaction(), option ), is( false ) ); assertThat( this.procedure.getStatementOptions( getTransaction() ).length, is( 1 ) ); final StatementOption statementOption = this.procedure.getStatementOptions( getTransaction() )[0]; assertThat( statementOption.getName( getTransaction() ), is( option ) ); assertThat( statementOption.getValue( getTransaction() ), is( ( Object )value ) ); }
@Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; }
StoredProcedureImpl extends AbstractProcedureImpl implements StoredProcedure { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } }
StoredProcedureImpl extends AbstractProcedureImpl implements StoredProcedure { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } StoredProcedureImpl( final UnitOfWork uow,
                                final Repository repository,
                                final String workspacePath ); }
StoredProcedureImpl extends AbstractProcedureImpl implements StoredProcedure { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } 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 ); }
StoredProcedureImpl extends AbstractProcedureImpl implements StoredProcedure { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } 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 );  }