/** * Add schemata to this mapping * * @param inputSchema The schema known at codegen time to be mapped * @param outputSchema The schema configured at run time to be mapped */ public void add(String inputSchema, String outputSchema) { logDeprecation(); // Find existing mapped schema MappedSchema schema = null; for (MappedSchema s : mapping().getSchemata()) { if (inputSchema.equals(s.getInput())) { schema = s; break; } } if (schema == null) { schema = new MappedSchema().withInput(inputSchema); mapping().getSchemata().add(schema); } // Add new mapping schema.setOutput(outputSchema); }
/** * Add schemata to this mapping * * @param inputSchema The schema known at codegen time to be mapped * @param outputSchema The schema configured at run time to be mapped */ public void add(String inputSchema, String outputSchema) { logDeprecation(); // Find existing mapped schema MappedSchema schema = null; for (MappedSchema s : mapping().getSchemata()) { if (inputSchema.equals(s.getInput())) { schema = s; break; } } if (schema == null) { schema = new MappedSchema().withInput(inputSchema); mapping().getSchemata().add(schema); } // Add new mapping schema.setOutput(outputSchema); }
if (s.getInput() != null && !s.getOutput().equals(schemaName)) result = new RenamedSchema(result, s.getOutput()); else if (s.getInputExpression() != null)
if (schemaName.equals(s.getInput())) { for (MappedTable t : s.getTables()) {
@Test(groups = "fast") public void testBuildSettings() throws Exception { final String settingsXML = "<settings xmlns=\"http://www.jooq.org/xsd/jooq-runtime-3.10.2.xsd\">\n" + " <renderMapping>\n" + " <schemata>\n" + " <schema>\n" + " <input>DEV</input>\n" + " <tables>\n" + " <table>\n" + " <input>AUTHOR</input>\n" + " <output>MY_APP__AUTHOR</output>\n" + " </table>\n" + " </tables>\n" + " </schema>\n" + " </schemata>\n" + " </renderMapping>\n" + "</settings>"; final Settings settings = PluginDao.getSettings(new ByteArrayInputStream(settingsXML.getBytes())); Assert.assertNotNull(settings); Assert.assertNotNull(settings.getRenderMapping()); Assert.assertNotNull(settings.getRenderMapping().getSchemata()); Assert.assertEquals(settings.getRenderMapping().getSchemata().size(), 1); Assert.assertEquals(settings.getRenderMapping().getSchemata().get(0).getInput(), "DEV"); Assert.assertEquals(settings.getRenderMapping().getSchemata().get(0).getTables().size(), 1); Assert.assertEquals(settings.getRenderMapping().getSchemata().get(0).getTables().get(0).getInput(), "AUTHOR"); Assert.assertEquals(settings.getRenderMapping().getSchemata().get(0).getTables().get(0).getOutput(), "MY_APP__AUTHOR"); } }
if (inputTable.getSchema().getName().equals(s.getInput())) {
if (inputTable.getSchema().getName().equals(s.getInput())) {