@Bean @Primary public Settings jooqSettings() { Settings ret = new Settings(); ret.withRenderSchema(false); ret.setRenderFormatted(true); ret.setRenderNameStyle(RenderNameStyle.AS_IS); return ret; }
@Bean SpanStore spanStore() { SpanStore result; if (datasource != null && server.getStore().getType() == Type.mysql) { result = new JDBCSpanStore(datasource, new Settings().withRenderSchema(false), listener); } else { result = new InMemorySpanStore(); } return result; }
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; } }