public Table addTable()

in rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java [469:502]


    public Table addTable(String tableName, String schemaName, String typeName) {    	
        Table table = null;
        
        if(this.config.isDatabaseSchemaNameSupported()){
        	table = getTable(schemaName+"."+tableName);	
        }
        else{
        	table = getTable(tableName);
        }
        
        if (table != null) {
        	if(this.config.isDatabaseSchemaNameSupported()){
        		throw new RuntimeException("Table " + schemaName+"."+tableName + "already exists");	
        	}
        	else{
        		throw new RuntimeException("Table " + tableName + "already exists");
        	}            
        }

        table = ConfigFactory.INSTANCE.createTable();
        table.setTableName(tableName);
        
        if(this.config.isDatabaseSchemaNameSupported()){
        	table.setSchemaName(schemaName);
        }
        else{
        	table.setSchemaName("");
        }
        
        table.setTypeName(typeName);
        config.getTable().add(table);

        return table;
    }