SchemaImpl extends RelationalObjectImpl implements Schema { @Override public byte[] export( final UnitOfWork transaction, final Properties properties ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); try { final StringBuffer result = new StringBuffer(); final Node schemaNode = node( transaction ); final DdlNodeVisitor visitor = new DdlNodeVisitor( TeiidVersionProvider.getInstance().getTeiidVersion(), false ); visitor.visit( schemaNode ); result.append( visitor.getDdl() ); return result.toString().getBytes(); } catch ( final Exception e ) { throw handleError( e ); } } SchemaImpl( final UnitOfWork uow,
                       final Repository repository,
                       final String workspacePath ); @Override byte[] export( final UnitOfWork transaction,
                          final Properties properties ); @Override String getRendition( final UnitOfWork uow ); @Override int getTypeId(); @Override KomodoType getTypeIdentifier( final UnitOfWork uow ); @Override void setRendition( final UnitOfWork uow,
                              final String rendition ); @Override DocumentType getDocumentType(UnitOfWork transaction);  }
@Test public void shouldExportEmptyDdl() throws Exception { byte[] fragmentBytes = this.schema.export(getTransaction(), new Properties()); final String fragment = new String(fragmentBytes); assertThat(fragment, is(notNullValue())); assertThat(fragment.isEmpty(), is(true)); }
@Test public void shouldExportDdl() throws Exception { setRenditionValueAwaitSequencing(DDL_VIEW); byte[] fragmentBytes = this.schema.export(getTransaction(), new Properties()); final String fragment = new String(fragmentBytes); assertThat(fragment, is(notNullValue())); assertThat(fragment.isEmpty(), is(false)); assertEquals(DDL_VIEW, fragment); }