public RenderMapping withSchemata(Collection<MappedSchema> values) { if (values!= null) { getSchemata().addAll(values); } return this; }
public RenderMapping withSchemata(MappedSchema... values) { if (values!= null) { for (MappedSchema value: values) { getSchemata().add(value); } } return this; }
public RenderMapping withSchemata(Collection<MappedSchema> values) { if (values!= null) { getSchemata().addAll(values); } return this; }
public RenderMapping withSchemata(MappedSchema... values) { if (values!= null) { for (MappedSchema value: values) { getSchemata().add(value); } } return this; }
/** * 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); }
@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 (!mapping().getSchemata().isEmpty()) { for (MappedSchema s : mapping().getSchemata()) {
MappedTable table = null; for (MappedSchema s : mapping().getSchemata()) { if (inputTable.getSchema().getName().equals(s.getInput())) { mapping().getSchemata().add(schema);
MappedTable table = null; for (MappedSchema s : mapping().getSchemata()) { if (inputTable.getSchema().getName().equals(s.getInput())) { mapping().getSchemata().add(schema);
for (MappedSchema s : mapping().getSchemata()) { if (schemaName.equals(s.getInput())) { for (MappedTable t : s.getTables()) {
Schema mapped = schema; for (MappedSchema s : mapping().getSchemata()) {
if (result != null && !mapping().getSchemata().isEmpty()) { Schema schema = result.getSchema(); for (MappedSchema s : mapping().getSchemata()) { if (matches(s, schemaName)) { for (MappedTable t : s.getTables()) {