/** * Defines that query should be automatically closed immediately after using. * Should be called before actual statement execution. */ public Q autoClose() { autoClose = true; return _this(); }
public Q concurrentReadOnly() { setConcurrencyType(QueryConcurrencyType.READ_ONLY); return _this(); } public Q concurrentUpdatable() {
public Q setHoldability(final QueryHoldability holdability) { checkCreated(); this.holdability = holdability; return _this(); }
/** * Resets creating generated columns. */ public Q resetGeneratedColumns() { checkCreated(); generatedColumns = null; return _this(); }
public Q typeScrollInsensitive() { setType(QueryScrollType.SCROLL_INSENSITIVE); return _this(); }
/** * Forces creation of prepared statements. */ public Q forcePreparedStatement() { checkCreated(); forcePreparedStatement = true; return _this(); }
public Q typeScrollSensitive() { setType(QueryScrollType.SCROLL_SENSITIVE); return _this(); } public Q typeScrollInsensitive() {
public Q setDebug(final boolean debug) { checkCreated(); this.debug = debug; return _this(); } public Q setDebugMode() {
/** * Specifies columns which values will be generated by database. */ public Q setGeneratedColumns(final String... columns) { checkCreated(); generatedColumns = columns; return _this(); }
public Q setType(final QueryScrollType type) { checkCreated(); this.type = type; return _this(); } public Q typeForwardOnly() {
public Q typeForwardOnly() { setType(QueryScrollType.FORWARD_ONLY); return _this(); } public Q typeScrollSensitive() {
public Q setConcurrencyType(final QueryConcurrencyType concurrencyType) { checkCreated(); this.concurrencyType = concurrencyType; return _this(); } public Q concurrentReadOnly() {
/** * Specifies that database will generate some columns values, * usually the single id. */ public Q setGeneratedKey() { setGeneratedColumns(); return _this(); }
public Q setDebugMode() { setDebug(true); return _this(); }
public Q holdCursorsOverCommit() { setHoldability(QueryHoldability.HOLD_CURSORS_OVER_COMMIT); return _this(); }
public Q concurrentUpdatable() { setConcurrencyType(QueryConcurrencyType.UPDATABLE); return _this(); }
public Q closeCursorsAtCommit() { setHoldability(QueryHoldability.CLOSE_CURSORS_AT_COMMIT); return _this(); }
/** * Closes all result sets created by this query. Query remains active. */ public Q closeAllResultSets() { final SQLException sex = closeQueryResultSets(); if (sex != null) { throw new DbSqlException("Close associated ResultSets error", sex); } return _this(); }
/** * Sets the limit for the maximum number of rows that any ResultSet object can contain to the given number. * If the limit is exceeded, the excess rows are silently dropped. Zero means there is no limit. * @see Statement#setMaxRows(int) */ public Q setMaxRows(final int maxRows) { checkNotClosed(); this.maxRows = maxRows; if (statement != null) { try { statement.setMaxRows(maxRows); } catch (SQLException sex) { throw new DbSqlException(this, "Unable to set max rows: " + maxRows, sex); } } return _this(); }
/** * Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when * more rows are needed. The number of rows specified affects only result sets created using this statement. * If the value specified is zero, then the hint is ignored. The default value is zero. * @see Statement#setFetchSize(int) */ public Q setFetchSize(final int rows) { checkNotClosed(); this.fetchSize = rows; if (statement != null) { try { statement.setFetchSize(fetchSize); } catch (SQLException sex) { throw new DbSqlException(this, "Unable to set fetch size: " + fetchSize, sex); } } return _this(); }