void applyStatementOptions(Statement statement) throws SQLException { if (options != null) { if (options.getQueryTimeout() > 0) { statement.setQueryTimeout(options.getQueryTimeout()); } if (options.getFetchDirection() != null) { statement.setFetchDirection(options.getFetchDirection().getType()); } if (options.getFetchSize() > 0) { statement.setFetchSize(options.getFetchSize()); } } }
public static void toJson(SQLOptions obj, java.util.Map<String, Object> json) { json.put("autoGeneratedKeys", obj.isAutoGeneratedKeys()); if (obj.getAutoGeneratedKeysIndexes() != null) { json.put("autoGeneratedKeysIndexes", obj.getAutoGeneratedKeysIndexes()); } if (obj.getCatalog() != null) { json.put("catalog", obj.getCatalog()); } if (obj.getFetchDirection() != null) { json.put("fetchDirection", obj.getFetchDirection().name()); } json.put("fetchSize", obj.getFetchSize()); json.put("queryTimeout", obj.getQueryTimeout()); json.put("readOnly", obj.isReadOnly()); if (obj.getResultSetConcurrency() != null) { json.put("resultSetConcurrency", obj.getResultSetConcurrency().name()); } if (obj.getResultSetType() != null) { json.put("resultSetType", obj.getResultSetType().name()); } if (obj.getSchema() != null) { json.put("schema", obj.getSchema()); } if (obj.getTransactionIsolation() != null) { json.put("transactionIsolation", obj.getTransactionIsolation().name()); } } }
/** * Copy constructor * * @param other the result to copy */ public SQLOptions(SQLOptions other) { this.readOnly = other.isReadOnly(); this.catalog = other.getCatalog(); this.transactionIsolation = other.getTransactionIsolation(); this.resultSetType = other.getResultSetType(); this.resultSetConcurrency = other.getResultSetConcurrency(); this.autoGeneratedKeys = other.isAutoGeneratedKeys(); this.autoGeneratedKeysIndexes = other.getAutoGeneratedKeysIndexes(); this.schema = other.getSchema(); this.queryTimeout = other.getQueryTimeout(); this.fetchDirection = other.getFetchDirection(); this.fetchSize = other.getFetchSize(); }