if (options.getAutoGeneratedKeysIndexes() == null) { generateKeys = true; return conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); if (options.getAutoGeneratedKeysIndexes().getValue(0) instanceof String) { String[] columnNames = new String[options.getAutoGeneratedKeysIndexes().size()]; for (int i = 0; i < columnNames.length; i++) { columnNames[i] = options.getAutoGeneratedKeysIndexes().getString(i); if (options.getAutoGeneratedKeysIndexes().getValue(0) instanceof Number) { int[] columnIndexes = new int[options.getAutoGeneratedKeysIndexes().size()]; for (int i = 0; i < columnIndexes.length; i++) { columnIndexes[i] = options.getAutoGeneratedKeysIndexes().getInteger(i);
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(); }