@Test public void testCrossReferenceFK() throws Exception { String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar, PRIMARY KEY(g1e1, g1e2));"; String ddl2 = "CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar, PRIMARY KEY(g2e1, g2e2), FOREIGN KEY (g2e1, g2e2) REFERENCES pm1.G1(g1e1, g1e2))"; buildModel("pm1", true, this.vdb, this.store, ddl); buildModel("pm2", true, this.vdb, this.store, ddl2); buildTransformationMetadata(); ValidatorReport report = new ValidatorReport(); report = new MetadataValidator().validate(this.vdb, this.store); assertFalse(printError(report), report.hasItems()); assertNotNull(this.store.getSchema("pm2").getTable("G2").getForeignKeys().get(0).getReferenceKey()); assertEquals(2, this.store.getSchema("pm2").getTable("G2").getForeignKeys().get(0).getReferenceKey().getColumns().size()); assertEquals("g1e1", this.store.getSchema("pm2").getTable("G2").getForeignKeys().get(0).getReferenceKey().getColumns().get(0).getName()); }
public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); ValidatorReport validate(VDBMetaData vdb, MetadataStore store); void log(ValidatorReport report, ModelMetaData model, String msg); void log(ValidatorReport report, ModelMetaData model, String msg, AbstractMetadataRecord object); void log(ValidatorReport report, ModelMetaData model, Severity severity, String msg, AbstractMetadataRecord object); void validate(VDBMetaData vdb, ModelMetaData model, AbstractMetadataRecord record, ValidatorReport report,
            QueryMetadataInterface metadata, MetadataFactory mf, QueryParser parser); static void determineDependencies(AbstractMetadataRecord p, Command command); }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); ValidatorReport validate(VDBMetaData vdb, MetadataStore store); void log(ValidatorReport report, ModelMetaData model, String msg); void log(ValidatorReport report, ModelMetaData model, String msg, AbstractMetadataRecord object); void log(ValidatorReport report, ModelMetaData model, Severity severity, String msg, AbstractMetadataRecord object); void validate(VDBMetaData vdb, ModelMetaData model, AbstractMetadataRecord record, ValidatorReport report,
            QueryMetadataInterface metadata, MetadataFactory mf, QueryParser parser); static void determineDependencies(AbstractMetadataRecord p, Command command); static final String UNTYPED; }