@Test public void testNestedJsonWithTypedName() throws Exception { CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor(); MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null); Table table = createTable(mf, KEYSPACE, "Sample"); mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, nestedJson(), mf, table, "Sample", false, new Dimension()); helpTest("nestedJsonTypedName.expected", mf); }
protected void scanRow(String key, String keyInSource, JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, Dimension dimension) { LogManager.logTrace(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29013, table, key, value)); if(isObjectJsonType(value)) { scanObjectRow(key, keyInSource, (JsonObject)value, mf, table, referenceTableName, isNestedType, dimension); } else if (isArrayJsonType(value)) { scanArrayRow(key, keyInSource, (JsonArray)value, mf, table, referenceTableName, isNestedType, dimension); } }
CouchbaseMetadataProcessor implements MetadataProcessor<CouchbaseConnection> { protected void scanRow(String key, String keyInSource, JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, Dimension dimension) { LogManager.logTrace(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29013, table, key, value)); if(isObjectJsonType(value)) { scanObjectRow(key, keyInSource, (JsonObject)value, mf, table, referenceTableName, isNestedType, dimension); } else if (isArrayJsonType(value)) { scanArrayRow(key, keyInSource, (JsonArray)value, mf, table, referenceTableName, isNestedType, dimension); } } }
CouchbaseMetadataProcessor implements MetadataProcessor<CouchbaseConnection> { protected void scanRow(String key, String keyInSource, JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, Dimension dimension) { LogManager.logTrace(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29013, table, key, value)); if(isObjectJsonType(value)) { scanObjectRow(key, keyInSource, (JsonObject)value, mf, table, referenceTableName, isNestedType, dimension); } else if (isArrayJsonType(value)) { scanArrayRow(key, keyInSource, (JsonArray)value, mf, table, referenceTableName, isNestedType, dimension); } }  }
CouchbaseMetadataProcessor implements MetadataProcessor<CouchbaseConnection> { protected void scanRow(String key, String keyInSource, JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, Dimension dimension) { LogManager.logTrace(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29013, table, key, value)); if(isObjectJsonType(value)) { scanObjectRow(key, keyInSource, (JsonObject)value, mf, table, referenceTableName, isNestedType, dimension); } else if (isArrayJsonType(value)) { scanArrayRow(key, keyInSource, (JsonArray)value, mf, table, referenceTableName, isNestedType, dimension); } }  @Override void process(MetadataFactory mf, CouchbaseConnection conn); @TranslatorProperty(display = "SampleSize", category = PropertyType.IMPORT, description = "Maximum number of documents per keyspace that should be map") //$NON-NLS-1$ //$NON-NLS-2$ int getSampleSize(); void setSampleSize(int sampleSize); @TranslatorProperty(display = "TypeNameList", category = PropertyType.IMPORT, description = "A comma-separated list of the attributes that the buckets use to specify document types. Each list item must be a bucket name surrounded by back quotes (`), a colon (:), and an attribute name surrounded by back quotes (`).") //$NON-NLS-1$ //$NON-NLS-2$ String getTypeNameList(); void setTypeNameList(String typeNameList); @TranslatorProperty(display = "SampleKeyspaces", category = PropertyType.IMPORT, description = "A comma-separated list of the keyspace names to define which keyspaces that should be map, default map all keyspaces") //$NON-NLS-1$ //$NON-NLS-2$ String getSampleKeyspaces(); void setSampleKeyspaces(String sampleKeyspaces); void setUseDouble(boolean useDouble); }
CouchbaseMetadataProcessor implements MetadataProcessor<CouchbaseConnection> { protected void scanRow(String key, String keyInSource, JsonValue value, MetadataFactory mf, Table table, String referenceTableName, boolean isNestedType, Dimension dimension) { LogManager.logTrace(LogConstants.CTX_CONNECTOR, CouchbasePlugin.Util.gs(CouchbasePlugin.Event.TEIID29013, table, key, value)); if(isObjectJsonType(value)) { scanObjectRow(key, keyInSource, (JsonObject)value, mf, table, referenceTableName, isNestedType, dimension); } else if (isArrayJsonType(value)) { scanArrayRow(key, keyInSource, (JsonArray)value, mf, table, referenceTableName, isNestedType, dimension); } }  @Override void process(MetadataFactory mf, CouchbaseConnection conn); @TranslatorProperty(display = "SampleSize", category = PropertyType.IMPORT, description = "Maximum number of documents per keyspace that should be map") //$NON-NLS-1$ //$NON-NLS-2$ int getSampleSize(); void setSampleSize(int sampleSize); @TranslatorProperty(display = "TypeNameList", category = PropertyType.IMPORT, description = "A comma-separated list of the attributes that the buckets use to specify document types. Each list item must be a bucket name surrounded by back quotes (`), a colon (:), and an attribute name surrounded by back quotes (`).") //$NON-NLS-1$ //$NON-NLS-2$ String getTypeNameList(); void setTypeNameList(String typeNameList); @TranslatorProperty(display = "SampleKeyspaces", category = PropertyType.IMPORT, description = "A comma-separated list of the keyspace names to define which keyspaces that should be map, default map all keyspaces") //$NON-NLS-1$ //$NON-NLS-2$ String getSampleKeyspaces(); void setSampleKeyspaces(String sampleKeyspaces); void setUseDouble(boolean useDouble); @ExtensionMetadataProperty(applicable = Table.class, datatype = Boolean.class, display = "Is Array Table", description = "Declare whether the table is array table")
    static final String IS_ARRAY_TABLE; @ExtensionMetadataProperty(applicable = Table.class, datatype = String.class, display = "Named Type Pair", description = "Declare the name of typed key/value pair")
    static final String NAMED_TYPE_PAIR; }