/** * Create an instance of {@link MappedTable } * */ public MappedTable createMappedTable() { return new MappedTable(); }
private final boolean matches(MappedTable t, String tableName) { return (t.getInput() != null && tableName.equals(t.getInput())) || (t.getInputExpression() != null && t.getInputExpression().matcher(tableName).matches()); }
public MappedTable withInput(String value) { setInput(value); return this; }
if (inputTable.getName().equals(t.getInput())) { table = t; break tableLoop; table = new MappedTable().withInput(inputTable.getName()); schema.getTables().add(table); table.setOutput(outputTable);
if (!isBlank(t.getOutput())) if (t.getInput() != null && !t.getOutput().equals(tableName)) result = new RenamedTable<R>(map(schema), result, t.getOutput()); else if (t.getInputExpression() != null) result = new RenamedTable<R>(map(schema), result, t.getInputExpression().matcher(tableName).replaceAll(t.getOutput()));
public MappedTable withOutput(String value) { setOutput(value); return this; }
public MappedTable withInputExpression(Pattern value) { setInputExpression(value); return this; }
if (inputTable.getName().equals(t.getInput())) { table = t; break tableLoop; table = new MappedTable().withInput(inputTable.getName()); schema.getTables().add(table); table.setOutput(outputTable);
@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"); } }
public MappedTable withOutput(String value) { setOutput(value); return this; }
/** * Create an instance of {@link MappedTable } * */ public MappedTable createMappedTable() { return new MappedTable(); }
public MappedTable withInput(String value) { setInput(value); return this; }
Settings settings = new Settings() .withRenderMapping(new RenderMapping() .withSchemata( new MappedSchema().withInput("MY_SCHEMA") .withOutput("MY_SCHEMA") .withTables( new MappedTable().withInput("CUSTOMER") .withOutput("CUSTOMER1"))));
Settings settings = new Settings() .withRenderMapping(new RenderMapping() .withSchemata( new MappedSchema().withInput("THE_SCHEMA") .withOutput("THE_SCHEMA") .withTables( new MappedTable().withInput("PREDEFINED_TABLE") .withOutput("CHANGED_TABLE") ) )); // Add the settings to the DSLContext DSLContext ctx = DSL.using(connection, dialect, settings); // Run your queries with the above ctx ctx.select(PREDEFINED_TABLE.COLUMM) .from(PREDEFINED_TABLE) .fetch();