Package org.apache.metamodel.schema

Examples of org.apache.metamodel.schema.MutableSchema


        _values.add(new Object[] { "3", "world" });

        _table = new MutableTable("table");
        _table.addColumn(new MutableColumn("foo", ColumnType.VARCHAR).setTable(_table).setColumnNumber(0));
        _table.addColumn(new MutableColumn("bar", ColumnType.VARCHAR).setTable(_table).setColumnNumber(1));
        _schema = new MutableSchema("schema", _table);
        _table.setSchema(_schema);
    }
View Full Code Here


  @Override
  public void execute() throws MetaModelException {
    CouchDbInstance instance = _updateCallback.getDataContext().getCouchDbInstance();
    Table table = getTable();
    MutableSchema schema = (MutableSchema) table.getSchema();
    schema.removeTable(table);
   
    instance.deleteDatabase(table.getName());
  }
View Full Code Here

    public CreateTable(Schema schema, String tableName) {
        _table = new MutableTable(tableName, TableType.TABLE, schema);
    }

    public CreateTable(String schemaName, String tableName) {
        _table = new MutableTable(tableName, TableType.TABLE, new MutableSchema(schemaName));
    }
View Full Code Here

    @Override
    protected Schema getMainSchema() throws MetaModelException {
        if (!_resource.isExists()) {
            logger.info("Resource does not exist, returning empty schema");
            return new MutableSchema(getMainSchemaName());
        }
        Ref<InputStream> inputStreamRef = getInputStreamRef();
        InputStream inputStream = null;
        try {
            SpreadsheetReaderDelegate delegate = getSpreadsheetReaderDelegate(inputStreamRef);
View Full Code Here

public class PostgresqlQueryRewriterTest extends TestCase {

  public void testRewriteLimit() throws Exception {
    MutableTable table = new MutableTable("foo");
    table.setSchema(new MutableSchema("MY_SCHEMA"));
    table.setQuote("\"");
    MutableColumn column = new MutableColumn("bar");
    column.setQuote("\"");
    column.setTable(table);
    Query q = new Query().from(table).select(column).setMaxRows(25).setFirstRow(5);
View Full Code Here

  public void testRewriteFromItem() throws Exception {
    PostgresqlQueryRewriter rewriter = new PostgresqlQueryRewriter(null);

    assertEquals("\"public\".foo",
        rewriter.rewriteFromItem(new FromItem(new MutableTable("foo").setSchema(new MutableSchema("public")))));
  }
View Full Code Here

     * @param autoFlattenTables
     */
    public XmlDomDataContext(String schemaName, Document document, boolean autoFlattenTables) {
        _autoFlattenTables = autoFlattenTables;
        _schemaName = schemaName;
        _schema = new MutableSchema(_schemaName);
        _inputSourceRef = null;
        loadSchema(document);
    }
View Full Code Here

    /**
     * Loads the schema if it hasn't been loaded before
     */
    public XmlDomDataContext loadSchema() {
        if (_schema == null) {
            _schema = new MutableSchema(_schemaName);
            InputSource inputSource = _inputSourceRef.get();
            try {
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                dbf.setIgnoringComments(true);
                DocumentBuilder db = dbf.newDocumentBuilder();
View Full Code Here

            newPrimaryColumn.setNativeType(foreignColumn.getNativeType());
            primaryTable.addColumn(newPrimaryColumn);
        }
        _tableData.put(primaryTableName, tableRows);

        MutableSchema mutableSchema = (MutableSchema) foreignTable.getSchema();
        mutableSchema.removeTable(foreignTable);

        _tableData.remove(foreignTableName);
        ((MutableRelationship) relationship).remove();

        if (logger.isInfoEnabled()) {
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        table = new MutableTable("foo");
        table.setSchema(new MutableSchema("MY_SCHEMA"));
        table.setQuote("\"");
        column = new MutableColumn("bar");
        column.setQuote("\"");
        column.setTable(table);
    }
View Full Code Here

TOP

Related Classes of org.apache.metamodel.schema.MutableSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.