/** * Lazy access to {@link RenderMapping}. */ public static final RenderMapping getRenderMapping(Settings settings) { if (settings.getRenderMapping() == null) settings.setRenderMapping(new RenderMapping()); return settings.getRenderMapping(); }
/** * Create an instance of {@link MappedTable } * */ public MappedTable createMappedTable() { return new MappedTable(); }
SQLDialect sqlDialect = SQLDialect.valueOf(dataSourceConfig.getSqlDialect()); DataSource dataSource = dataSourceConfig.createDataSource(); Settings settings = new Settings(); settings.setRenderNameStyle(RenderNameStyle.AS_IS); final JdbcKeyValueService kvs = new JdbcKeyValueService( settings,
/** * Create an instance of {@link Settings } * */ public Settings createSettings() { return new Settings(); }
Settings settings = new Settings() .withRenderMapping(new RenderMapping() .withSchemata( new MappedSchema().withInput("MY_SCHEMA") .withOutput("MY_SCHEMA") .withTables( new MappedTable().withInput("CUSTOMER") .withOutput("CUSTOMER1"))));
/** * Create an instance of {@link MappedSchema } * */ public MappedSchema createMappedSchema() { return new MappedSchema(); }
/** * Whether a {@link PreparedStatement} should be executed. */ public static final boolean executePreparedStatements(Settings settings) { return getStatementType(settings) == PREPARED_STATEMENT; }
/** * Get the statement type from the settings. */ public static final StatementType getStatementType(Settings settings) { if (settings != null) { StatementType result = settings.getStatementType(); if (result != null) { return result; } } return PREPARED_STATEMENT; }
/** * Lazy access to {@link Settings#getExecuteDeleteWithoutWhere()}. */ public static final ExecuteWithoutWhere getExecuteDeleteWithoutWhere(Settings settings) { ExecuteWithoutWhere result = settings.getExecuteDeleteWithoutWhere(); return result == null ? ExecuteWithoutWhere.LOG_DEBUG : result; }
/** * Return <code>maxRows</code> if it is not <code>0</code>, or the specified * {@link Settings#getMaxRows()}. */ public static final int getMaxRows(int maxRows, Settings settings) { return maxRows != 0 ? maxRows : settings.getMaxRows() != null ? settings.getMaxRows() : 0; }
/** * Create an instance of {@link RenderFormatting } * */ public RenderFormatting createRenderFormatting() { return new RenderFormatting(); }
/** * Return <code>fetchServerOutputSize</code> if it is not <code>0</code>, or * the specified {@link Settings#getFetchServerOutputSize()}. */ public static final int getFetchServerOutputSize(int fetchServerOutputSize, Settings settings) { return fetchServerOutputSize != 0 ? fetchServerOutputSize : settings.getFetchServerOutputSize() != null ? settings.getFetchServerOutputSize() : 0; } }
/** * Lazy access to {@link Settings#getExecuteUpdateWithoutWhere()}. */ public static final ExecuteWithoutWhere getExecuteUpdateWithoutWhere(Settings settings) { ExecuteWithoutWhere result = settings.getExecuteUpdateWithoutWhere(); return result == null ? ExecuteWithoutWhere.LOG_DEBUG : result; }
/** * Return <code>fetchSize</code> if it is not <code>0</code>, or the specified * {@link Settings#getFetchSize()}. */ public static final int getFetchSize(int fetchSize, Settings settings) { return fetchSize != 0 ? fetchSize : settings.getFetchSize() != null ? settings.getFetchSize() : 0; }
/** * Lazy access to {@link RenderMapping}. */ public static final RenderMapping getRenderMapping(Settings settings) { if (settings.getRenderMapping() == null) { settings.setRenderMapping(new RenderMapping()); } return settings.getRenderMapping(); }
/** * Create an instance of {@link MappedSchema } * */ public MappedSchema createMappedSchema() { return new MappedSchema(); }
/** * Whether static {@link Statement} should be executed. */ public static final boolean executeStaticStatements(Settings settings) { return getStatementType(settings) == STATIC_STATEMENT; }
/** * Get the statement type from the settings. */ public static final StatementType getStatementType(Settings settings) { if (settings != null) { StatementType result = settings.getStatementType(); if (result != null) return result; } return PREPARED_STATEMENT; }
/** * Whether static {@link Statement} should be executed. */ public static final boolean executeStaticStatements(Settings settings) { return getStatementType(settings) == STATIC_STATEMENT; }