/** * Create an instance of {@link RenderMapping } * */ public RenderMapping createRenderMapping() { return new RenderMapping(); }
/** * Create an instance of {@link RenderMapping } * */ public RenderMapping createRenderMapping() { return new RenderMapping(); }
/** * Lazy access to {@link RenderMapping}. */ public static final RenderMapping getRenderMapping(Settings settings) { if (settings.getRenderMapping() == null) settings.setRenderMapping(new RenderMapping()); return settings.getRenderMapping(); }
Settings settings = new Settings() .withRenderMapping(new RenderMapping() .withSchemata( new MappedSchema().withInput("MY_SCHEMA") .withOutput("MY_SCHEMA") .withTables( new MappedTable().withInput("CUSTOMER") .withOutput("CUSTOMER1"))));
/** * Lazy access to {@link RenderMapping}. */ public static final RenderMapping getRenderMapping(Settings settings) { if (settings.getRenderMapping() == null) { settings.setRenderMapping(new RenderMapping()); } return settings.getRenderMapping(); }
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();
public PluginDao(final DataSource dataSource, final SQLDialect dialect) throws SQLException { this.dataSource = dataSource; this.dialect = dialect; switch (dialect) { case H2: final String schema; Connection connection = null; try { connection = dataSource.getConnection(); schema = connection.getSchema(); } finally { if (connection != null) { connection.close(); } } final MappedSchema mappedSchema = new MappedSchema().withInput(DEFAULT_SCHEMA_NAME) // As defined by the jOOQ codegen .withOutput(schema); final RenderMapping renderMapping = new RenderMapping().withSchemata(mappedSchema); this.settings = new Settings().withRenderMapping(renderMapping) .withRenderNameStyle(RenderNameStyle.UPPER); break; default: // For MySQL, schema doesn't matter. // For PostgreSQL, assume schema is part of the JDBC url this.settings = new Settings().withRenderSchema(false); break; } }