org.jooq.impl
Class FactoryProxy

java.lang.Object
  extended by org.jooq.impl.FactoryProxy
All Implemented Interfaces:
Serializable, Configuration, FactoryOperations

Deprecated. - Use the newly DataSource-enabled Factory constructors instead, e.g. Factory.Factory(DataSource, SQLDialect) or Factory.Factory(DataSource, SQLDialect, Settings)

@Deprecated
public final class FactoryProxy
extends Object
implements FactoryOperations

Thread safe proxy for Factory.

The FactoryProxy operates as a thread-safe proxy for jOOQ's Factory objects. Instead of wrapping JDBC Connection objects, the FactoryProxy wraps a transaction-aware DataSource and creates a new Factory with a new Connection every time you use any of the operations from FactoryOperations

Refer to the jOOQ manual to see possible operation modes for jOOQ with Spring. Note that this implementation of a FactoryProxy might be re-designed in jOOQ 3.0. Please consider this functionality as being EXPERIMENTAL

Author:
Sergey Epik, Lukas Eder
See Also:
Serialized Form

Constructor Summary
FactoryProxy()
          Deprecated.  
 
Method Summary
 void attach(Attachable... attachables)
          Deprecated. Attach this Factory to some attachables
 void attach(Collection<Attachable> attachables)
          Deprecated. Attach this Factory to some attachables
 Batch batch(Collection<? extends Query> queries)
          Deprecated. Execute a set of queries in batch mode (without bind values).
 Batch batch(Query... queries)
          Deprecated. Execute a set of queries in batch mode (without bind values).
 BatchBindStep batch(Query query)
          Deprecated. Execute a set of queries in batch mode (with bind values).
 Batch batchStore(Collection<? extends UpdatableRecord<?>> records)
          Deprecated. Execute a set of INSERT and UPDATE queries in batch mode (with bind values).
 Batch batchStore(UpdatableRecord<?>... records)
          Deprecated. Execute a set of INSERT and UPDATE queries in batch mode (with bind values).
 void commit()
          Deprecated. Convenience method to access Connection.commit() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
<T extends Number>
T
currval(Sequence<T> sequence)
          Deprecated. Convenience method to fetch the CURRVAL for a sequence directly from this Factory's underlying JDBC Connection
<R extends Record>
DeleteWhereStep<R>
delete(Table<R> table)
          Deprecated. Create a new DSL delete statement.
<R extends Record>
DeleteQuery<R>
deleteQuery(Table<R> table)
          Deprecated. Create a new DeleteQuery
 int execute(String sql)
          Deprecated. Execute a query holding plain SQL.
 int execute(String sql, Object... bindings)
          Deprecated. Execute a new query holding plain SQL.
 int execute(String sql, QueryPart... parts)
          Deprecated. Execute a new query holding plain SQL.
<R extends UpdatableRecord<R>>
int
executeDelete(R record)
          Deprecated. Delete a record from a table DELETE FROM [table] WHERE [record is supplied record]
<R extends TableRecord<R>,T>
int
executeDelete(R record, Condition condition)
          Deprecated. Delete a record from a table DELETE FROM [table] WHERE [condition]
<R extends TableRecord<R>>
int
executeDelete(Table<R> table)
          Deprecated. 
<R extends TableRecord<R>,T>
int
executeDelete(Table<R> table, Condition condition)
          Deprecated. 
<R extends TableRecord<R>>
int
executeDeleteOne(Table<R> table)
          Deprecated. 
<R extends TableRecord<R>,T>
int
executeDeleteOne(Table<R> table, Condition condition)
          Deprecated. 
<R extends TableRecord<R>>
int
executeInsert(R record)
          Deprecated. Insert one record This executes something like the following statement: INSERT INTO [table] ...
<R extends TableRecord<R>>
int
executeInsert(Table<R> table, R record)
          Deprecated. 
<R extends UpdatableRecord<R>>
int
executeUpdate(R record)
          Deprecated. Update a table UPDATE [table] SET [modified values in record] WHERE [record is supplied record]
<R extends TableRecord<R>,T>
int
executeUpdate(R record, Condition condition)
          Deprecated. Update a table UPDATE [table] SET [modified values in record] WHERE [condition]
<R extends TableRecord<R>>
int
executeUpdate(Table<R> table, R record)
          Deprecated. 
<R extends TableRecord<R>,T>
int
executeUpdate(Table<R> table, R record, Condition condition)
          Deprecated. 
<R extends TableRecord<R>>
int
executeUpdateOne(Table<R> table, R record)
          Deprecated. 
<R extends TableRecord<R>,T>
int
executeUpdateOne(Table<R> table, R record, Condition condition)
          Deprecated. 
 Result<Record> fetch(ResultSet rs)
          Deprecated. Fetch all data from a JDBC ResultSet and transform it to a jOOQ Result.
 Result<Record> fetch(String sql)
          Deprecated. Execute a new query holding plain SQL.
 Result<Record> fetch(String sql, Object... bindings)
          Deprecated. Execute a new query holding plain SQL.
 Result<Record> fetch(String sql, QueryPart... parts)
          Deprecated. Execute a new query holding plain SQL.
<R extends Record>
Result<R>
fetch(Table<R> table)
          Deprecated. Execute and return all records for SELECT * FROM [table] The result and its contained records are attached to this Configuration by default.
<R extends Record>
Result<R>
fetch(Table<R> table, Condition condition)
          Deprecated. Execute and return all records for SELECT * FROM [table] WHERE [condition] The result and its contained records are attached to this Configuration by default.
<R extends Record>
R
fetchAny(Table<R> table)
          Deprecated. Execute and return zero or one record for SELECT * FROM [table] LIMIT 1 The resulting record is attached to this Configuration by default.
 Result<Record> fetchFromCSV(String string)
          Deprecated. Fetch all data from a CSV string.
 Result<Record> fetchFromCSV(String string, char delimiter)
          Deprecated. Fetch all data from a CSV string.
 Cursor<Record> fetchLazy(ResultSet rs)
          Deprecated. Fetch all data from a JDBC ResultSet and transform it to a jOOQ Result.
 Cursor<Record> fetchLazy(String sql)
          Deprecated. Execute a new query holding plain SQL and "lazily" return the generated result.
 Cursor<Record> fetchLazy(String sql, Object... bindings)
          Deprecated. Execute a new query holding plain SQL and "lazily" return the generated result.
 Cursor<Record> fetchLazy(String sql, QueryPart... parts)
          Deprecated. Execute a new query holding plain SQL and "lazily" return the generated result.
 List<Result<Record>> fetchMany(String sql)
          Deprecated. Execute a new query holding plain SQL, possibly returning several result sets Example (Sybase ASE): String sql = "sp_help 'my_table'"; NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity.
 List<Result<Record>> fetchMany(String sql, Object... bindings)
          Deprecated. Execute a new query holding plain SQL, possibly returning several result sets.
 List<Result<Record>> fetchMany(String sql, QueryPart... parts)
          Deprecated. Execute a new query holding plain SQL, possibly returning several result sets.
 Record fetchOne(String sql)
          Deprecated. Execute a new query holding plain SQL.
 Record fetchOne(String sql, Object... bindings)
          Deprecated. Execute a new query holding plain SQL.
 Record fetchOne(String sql, QueryPart... parts)
          Deprecated. Execute a new query holding plain SQL.
<R extends Record>
R
fetchOne(Table<R> table)
          Deprecated. Execute and return zero or one record for SELECT * FROM [table] The resulting record is attached to this Configuration by default.
<R extends Record>
R
fetchOne(Table<R> table, Condition condition)
          Deprecated. Execute and return zero or one record for SELECT * FROM [table] WHERE [condition] The resulting record is attached to this Configuration by default.
 boolean getAutoCommit()
          Deprecated. Convenience method to access Connection.getAutoCommit() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 Connection getConnection()
          Deprecated. Retrieve the configured connection If you configured a data source for this Configuration (see Configuration.setDataSource(DataSource)), then this may initialise a new connection.
 Map<String,Object> getData()
          Deprecated. Get all custom data from this Configuration This is custom data that was previously set to the configuration using Configuration.setData(String, Object).
 Object getData(String key)
          Deprecated. Get some custom data from this Configuration This is custom data that was previously set to the configuration using Configuration.setData(String, Object).
 DataSource getDataSource()
          Deprecated. Retrieve the configured data source
 SQLDialect getDialect()
          Deprecated. Retrieve the configured dialect
 int getHoldability()
          Deprecated. Convenience method to access Connection.getHoldability() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 SchemaMapping getSchemaMapping()
          Deprecated. 
 Settings getSettings()
          Deprecated. Retrieve the runtime configuration settings
 int getTransactionIsolation()
          Deprecated. Convenience method to access Connection.getTransactionIsolation() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
<R extends Record>
InsertSetStep<R>
insertInto(Table<R> into)
          Deprecated. Create a new DSL insert statement.
<R extends Record>
InsertValuesStep<R>
insertInto(Table<R> into, Collection<? extends Field<?>> fields)
          Deprecated. Create a new DSL insert statement.
<R extends Record>
InsertValuesStep<R>
insertInto(Table<R> into, Field<?>... fields)
          Deprecated. Create a new DSL insert statement.
<R extends Record>
Insert<R>
insertInto(Table<R> into, Select<?> select)
          Deprecated. 
<R extends Record>
InsertQuery<R>
insertQuery(Table<R> into)
          Deprecated. Create a new InsertQuery
 BigInteger lastID()
          Deprecated. Retrieve the last inserted ID.
<R extends TableRecord<R>>
LoaderOptionsStep<R>
loadInto(Table<R> table)
          Deprecated. Create a new Loader object to load data from a CSV or XML source
<R extends Record>
MergeUsingStep<R>
mergeInto(Table<R> table)
          Deprecated. Create a new DSL SQL standard MERGE statement.
<R extends Record>
MergeKeyStep<R>
mergeInto(Table<R> table, Collection<? extends Field<?>> fields)
          Deprecated. Create a new DSL merge statement (H2-specific syntax)
<R extends Record>
MergeKeyStep<R>
mergeInto(Table<R> table, Field<?>... fields)
          Deprecated. Create a new DSL merge statement (H2-specific syntax) This statement is available from DSL syntax only.
<R extends TableRecord<R>>
R
newRecord(Table<R> table)
          Deprecated. Create a new Record that can be inserted into the corresponding table.
<R extends TableRecord<R>>
R
newRecord(Table<R> table, Object source)
          Deprecated. Create a new pre-filled Record that can be inserted into the corresponding table.
<R extends UDTRecord<R>>
R
newRecord(UDT<R> type)
          Deprecated. Create a new UDTRecord.
<T extends Number>
T
nextval(Sequence<T> sequence)
          Deprecated. Convenience method to fetch the NEXTVAL for a sequence directly from this Factory's underlying JDBC Connection
 Query query(String sql)
          Deprecated. Create a new query holding plain SQL.
 Query query(String sql, Object... bindings)
          Deprecated. Create a new query holding plain SQL.
 Query query(String sql, QueryPart... parts)
          Deprecated. Create a new query holding plain SQL.
 void releaseSavepoint(Savepoint savepoint)
          Deprecated. Convenience method to access Connection.releaseSavepoint(Savepoint) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 String render(QueryPart part)
          Deprecated. Render a QueryPart in the context of this factory This is the same as calling renderContext().render(part)
 String renderInlined(QueryPart part)
          Deprecated. Render a QueryPart in the context of this factory, inlining all bind variables.
 String renderNamedParams(QueryPart part)
          Deprecated. Render a QueryPart in the context of this factory, rendering bind variables as named parameters.
 ResultQuery<Record> resultQuery(String sql)
          Deprecated. Create a new query holding plain SQL.
 ResultQuery<Record> resultQuery(String sql, Object... bindings)
          Deprecated. Create a new query holding plain SQL.
 ResultQuery<Record> resultQuery(String sql, QueryPart... parts)
          Deprecated. Create a new query holding plain SQL.
 void rollback()
          Deprecated. Convenience method to access Connection.rollback() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 void rollback(Savepoint savepoint)
          Deprecated. Convenience method to access Connection.rollback(Savepoint) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 SelectSelectStep select(Collection<? extends Field<?>> fields)
          Deprecated. Create a new DSL select statement.
 SelectSelectStep select(Field<?>... fields)
          Deprecated. Create a new DSL select statement.
 SelectSelectStep selectCount()
          Deprecated. Create a new DSL select statement for COUNT(*) Example: Factory create = new Factory(); create.selectCount() .from(table1) .join(table2).on(field1.equal(field2)) .where(field1.greaterThan(100)) .orderBy(field2) .execute();
 SelectSelectStep selectDistinct(Collection<? extends Field<?>> fields)
          Deprecated. Create a new DSL select statement.
 SelectSelectStep selectDistinct(Field<?>... fields)
          Deprecated. Create a new DSL select statement.
<R extends Record>
SimpleSelectWhereStep<R>
selectFrom(Table<R> table)
          Deprecated. Create a new DSL select statement Example: SELECT * FROM [table] WHERE [conditions] ORDER BY [ordering] LIMIT [limit clause]
 SelectSelectStep selectOne()
          Deprecated. Create a new DSL select statement for constant 1 literal Example: Factory create = new Factory(); create.selectOne() .from(table1) .join(table2).on(field1.equal(field2)) .where(field1.greaterThan(100)) .orderBy(field2) .execute();
 SelectQuery selectQuery()
          Deprecated. Create a new SelectQuery
<R extends Record>
SimpleSelectQuery<R>
selectQuery(TableLike<R> table)
          Deprecated. Create a new SelectQuery
 SelectSelectStep selectZero()
          Deprecated. Create a new DSL select statement for constant 0 literal Example: Factory create = new Factory(); create.selectZero() .from(table1) .join(table2).on(field1.equal(field2)) .where(field1.greaterThan(100)) .orderBy(field2) .execute();
 void setAutoCommit(boolean autoCommit)
          Deprecated. Convenience method to access Connection.setAutoCommit(boolean) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 void setConnection(Connection connection)
          Deprecated. Set the configured connection If you provide a JDBC connection to a jOOQ Factory, jOOQ will use that connection for creating statements, but it will never call any of these methods: Connection.commit() Connection.rollback() Connection.close() Use this constructor if you want to handle transactions directly on the connection.
 Object setData(String key, Object value)
          Deprecated. Set some custom data to this Configuration Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.
 void setDataSource(DataSource dataSource)
          Deprecated. Set the configured data source If you provide a JDBC data source to a jOOQ Factory, jOOQ will use that data source for initialising connections, and creating statements.
 void setDialect(SQLDialect dialect)
          Deprecated.  
 void setHoldability(int holdability)
          Deprecated. Convenience method to access Connection.setHoldability(int) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 Savepoint setSavepoint()
          Deprecated. Convenience method to access Connection.setSavepoint() Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 Savepoint setSavepoint(String name)
          Deprecated. Convenience method to access Connection.setSavepoint(String) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
 void setSettings(Settings settings)
          Deprecated.  
 void setTransactionIsolation(int level)
          Deprecated. Convenience method to access Connection.setTransactionIsolation(int) Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction.
<R extends Record>
Truncate<R>
truncate(Table<R> table)
          Deprecated. Create a new DSL truncate statement.
<R extends Record>
UpdateSetStep<R>
update(Table<R> table)
          Deprecated. Create a new DSL update statement.
<R extends Record>
UpdateQuery<R>
updateQuery(Table<R> table)
          Deprecated. Create a new UpdateQuery
 int use(Schema schema)
          Deprecated. Use a schema as the default schema of the underlying connection.
 int use(String schema)
          Deprecated. Use a schema as the default schema of the underlying connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryProxy

public FactoryProxy()
Deprecated. 
Method Detail

setDialect

public final void setDialect(SQLDialect dialect)
Deprecated. 

setSettings

public final void setSettings(Settings settings)
Deprecated. 

setDataSource

public final void setDataSource(DataSource dataSource)
Deprecated. 
Description copied from interface: Configuration
Set the configured data source

If you provide a JDBC data source to a jOOQ Factory, jOOQ will use that data source for initialising connections, and creating statements.

Use data sources if you want to run distributed transactions, such as javax.transaction.UserTransaction. If you provide jOOQ factories with a data source, jOOQ will close() all connections after query execution in order to return the connection to the connection pool. If you do not use distributed transactions, this will produce driver-specific behaviour at the end of query execution at close() invocation (e.g. a transaction rollback). Use Configuration.setConnection(Connection) instead, to control the connection's lifecycle.

Specified by:
setDataSource in interface Configuration

getDataSource

public final DataSource getDataSource()
Deprecated. 
Description copied from interface: Configuration
Retrieve the configured data source

Specified by:
getDataSource in interface Configuration

getDialect

public final SQLDialect getDialect()
Deprecated. 
Description copied from interface: Configuration
Retrieve the configured dialect

Specified by:
getDialect in interface Configuration

getSchemaMapping

@Deprecated
public final SchemaMapping getSchemaMapping()
Deprecated. 

Description copied from interface: Configuration
Retrieve the configured schema mapping

Specified by:
getSchemaMapping in interface Configuration

getSettings

public final Settings getSettings()
Deprecated. 
Description copied from interface: Configuration
Retrieve the runtime configuration settings

Specified by:
getSettings in interface Configuration

getConnection

public final Connection getConnection()
Deprecated. 
Description copied from interface: Configuration
Retrieve the configured connection

If you configured a data source for this Configuration (see Configuration.setDataSource(DataSource)), then this may initialise a new connection.

Specified by:
getConnection in interface Configuration

setConnection

public final void setConnection(Connection connection)
Deprecated. 
Description copied from interface: Configuration
Set the configured connection

If you provide a JDBC connection to a jOOQ Factory, jOOQ will use that connection for creating statements, but it will never call any of these methods:

Use this constructor if you want to handle transactions directly on the connection.

Specified by:
setConnection in interface Configuration

getData

public final Map<String,Object> getData()
Deprecated. 
Description copied from interface: Configuration
Get all custom data from this Configuration

This is custom data that was previously set to the configuration using Configuration.setData(String, Object). Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.

See ExecuteListener for more details.

Specified by:
getData in interface Configuration
Returns:
The custom data. This is never null
See Also:
ExecuteListener

getData

public final Object getData(String key)
Deprecated. 
Description copied from interface: Configuration
Get some custom data from this Configuration

This is custom data that was previously set to the configuration using Configuration.setData(String, Object). Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.

See ExecuteListener for more details.

Specified by:
getData in interface Configuration
Parameters:
key - A key to identify the custom data
Returns:
The custom data or null if no such data is contained in this Configuration
See Also:
ExecuteListener

setData

public final Object setData(String key,
                            Object value)
Deprecated. 
Description copied from interface: Configuration
Set some custom data to this Configuration

Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.

Be sure that your custom data implements Serializable if you want to serialise this Configuration or objects referencing this Configuration, e.g. your Record types.

See ExecuteListener for more details.

Specified by:
setData in interface Configuration
Parameters:
key - A key to identify the custom data
value - The custom data or null to unset the custom data
Returns:
The previously set custom data or null if no data was previously set for the given key
See Also:
ExecuteListener

loadInto

public final <R extends TableRecord<R>> LoaderOptionsStep<R> loadInto(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new Loader object to load data from a CSV or XML source

Specified by:
loadInto in interface FactoryOperations

render

public final String render(QueryPart part)
Deprecated. 
Description copied from interface: FactoryOperations
Render a QueryPart in the context of this factory

This is the same as calling renderContext().render(part)

Specified by:
render in interface FactoryOperations
Parameters:
part - The QueryPart to be rendered
Returns:
The rendered SQL

renderNamedParams

public final String renderNamedParams(QueryPart part)
Deprecated. 
Description copied from interface: FactoryOperations
Render a QueryPart in the context of this factory, rendering bind variables as named parameters.

This is the same as calling renderContext().namedParams(true).render(part)

Specified by:
renderNamedParams in interface FactoryOperations
Parameters:
part - The QueryPart to be rendered
Returns:
The rendered SQL

renderInlined

public final String renderInlined(QueryPart part)
Deprecated. 
Description copied from interface: FactoryOperations
Render a QueryPart in the context of this factory, inlining all bind variables.

This is the same as calling renderContext().inline(true).render(part)

Specified by:
renderInlined in interface FactoryOperations
Parameters:
part - The QueryPart to be rendered
Returns:
The rendered SQL

attach

public final void attach(Attachable... attachables)
Deprecated. 
Description copied from interface: FactoryOperations
Attach this Factory to some attachables

Specified by:
attach in interface FactoryOperations

attach

public final void attach(Collection<Attachable> attachables)
Deprecated. 
Description copied from interface: FactoryOperations
Attach this Factory to some attachables

Specified by:
attach in interface FactoryOperations

query

public final Query query(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL. There must not be any binding variables contained in the SQL

Example:

 String sql = "SET SCHEMA 'abc'";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
query in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
A query wrapping the plain SQL

query

public final Query query(String sql,
                         Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

Example:

 String sql = "SET SCHEMA 'abc'";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
query in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
A query wrapping the plain SQL

query

public final Query query(String sql,
                         QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL.

Unlike FactoryOperations.query(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 query("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
query in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
A query wrapping the plain SQL

selectFrom

public final <R extends Record> SimpleSelectWhereStep<R> selectFrom(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement

Example:

 SELECT * FROM [table] WHERE [conditions] ORDER BY [ordering] LIMIT [limit clause]
 

Specified by:
selectFrom in interface FactoryOperations

select

public final SelectSelectStep select(Field<?>... fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement.

Example:

 Factory create = new Factory();

 create.select(field1, field2)
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2)
       .execute();
 

Specified by:
select in interface FactoryOperations

selectZero

public final SelectSelectStep selectZero()
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement for constant 0 literal

Example:

 Factory create = new Factory();

 create.selectZero()
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2)
       .execute();
 

Specified by:
selectZero in interface FactoryOperations
See Also:
Factory.zero()

selectOne

public final SelectSelectStep selectOne()
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement for constant 1 literal

Example:

 Factory create = new Factory();

 create.selectOne()
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2)
       .execute();
 

Specified by:
selectOne in interface FactoryOperations
See Also:
Factory.one()

selectCount

public final SelectSelectStep selectCount()
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement for COUNT(*)

Example:

 Factory create = new Factory();

 create.selectCount()
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2)
       .execute();
 

Specified by:
selectCount in interface FactoryOperations

selectDistinct

public final SelectSelectStep selectDistinct(Field<?>... fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement.

Example:

 Factory create = new Factory();

 create.selectDistinct(field1, field2)
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2);
 

Specified by:
selectDistinct in interface FactoryOperations

select

public final SelectSelectStep select(Collection<? extends Field<?>> fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement.

Example:

 Factory create = new Factory();

 create.select(fields)
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2);
 

Specified by:
select in interface FactoryOperations

selectDistinct

public final SelectSelectStep selectDistinct(Collection<? extends Field<?>> fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL select statement.

Example:

 Factory create = new Factory();

 create.selectDistinct(fields)
       .from(table1)
       .join(table2).on(field1.equal(field2))
       .where(field1.greaterThan(100))
       .orderBy(field2);
 

Specified by:
selectDistinct in interface FactoryOperations

selectQuery

public final SelectQuery selectQuery()
Deprecated. 
Description copied from interface: FactoryOperations
Create a new SelectQuery

Specified by:
selectQuery in interface FactoryOperations

selectQuery

public final <R extends Record> SimpleSelectQuery<R> selectQuery(TableLike<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new SelectQuery

Specified by:
selectQuery in interface FactoryOperations
Parameters:
table - The table to select data from
Returns:
The new SelectQuery

insertQuery

public final <R extends Record> InsertQuery<R> insertQuery(Table<R> into)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new InsertQuery

Specified by:
insertQuery in interface FactoryOperations
Parameters:
into - The table to insert data into
Returns:
The new InsertQuery

insertInto

public final <R extends Record> InsertSetStep<R> insertInto(Table<R> into)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL insert statement. This type of insert may feel more convenient to some users, as it uses the UPDATE statement's SET a = b syntax.

Example:

 Factory create = new Factory();

 create.insertInto(table)
       .set(field1, value1)
       .set(field2, value2)
       .newRecord()
       .set(field1, value3)
       .set(field2, value4)
       .onDuplicateKeyUpdate()
       .set(field1, value1)
       .set(field2, value2)
       .execute();
 

Specified by:
insertInto in interface FactoryOperations

insertInto

public final <R extends Record> InsertValuesStep<R> insertInto(Table<R> into,
                                                               Field<?>... fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL insert statement.

Example:

 Factory create = new Factory();

 create.insertInto(table, field1, field2)
       .values(value1, value2)
       .values(value3, value4)
       .onDuplicateKeyUpdate()
       .set(field1, value1)
       .set(field2, value2)
       .execute();
 

Specified by:
insertInto in interface FactoryOperations

insertInto

public final <R extends Record> InsertValuesStep<R> insertInto(Table<R> into,
                                                               Collection<? extends Field<?>> fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL insert statement.

Example:

 Factory create = new Factory();

 create.insertInto(table, field1, field2)
       .values(value1, value2)
       .values(value3, value4)
       .onDuplicateKeyUpdate()
       .set(field1, value1)
       .set(field2, value2)
       .execute();
 

Specified by:
insertInto in interface FactoryOperations

insertInto

@Deprecated
public final <R extends Record> Insert<R> insertInto(Table<R> into,
                                                                Select<?> select)
Deprecated. 

Description copied from interface: FactoryOperations
Create a new DSL insert statement.

Example:

 Factory create = new Factory();

 create.insertInto(table, create.select(1))
       .execute();
 

Specified by:
insertInto in interface FactoryOperations

updateQuery

public final <R extends Record> UpdateQuery<R> updateQuery(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new UpdateQuery

Specified by:
updateQuery in interface FactoryOperations
Parameters:
table - The table to update data into
Returns:
The new UpdateQuery

update

public final <R extends Record> UpdateSetStep<R> update(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL update statement.

Example:

 Factory create = new Factory();

 create.update(table)
       .set(field1, value1)
       .set(field2, value2)
       .where(field1.greaterThan(100))
       .execute();
 

Specified by:
update in interface FactoryOperations

mergeInto

public final <R extends Record> MergeUsingStep<R> mergeInto(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL SQL standard MERGE statement.

This statement is available from DSL syntax only. It is known to be supported in some way by any of these dialects:

dialect support type documentation
DB2 SQL:2008 standard and major enhancements http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com. ibm.db2.udb.admin.doc/doc/r0010873.htm
HSQLDB SQL:2008 standard http://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html#N129BA
Oracle SQL:2008 standard and minor enhancements http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/ statements_9016.htm
SQL Server Similar to SQL:2008 standard with some major enhancements http://msdn.microsoft.com/de-de/library/bb510625.aspx
Sybase Similar to SQL:2008 standard with some major enhancements http://dcx.sybase.com/1100/en/dbreference_en11/merge-statement.html

Example:

 Factory create = new Factory();

 create.mergeInto(table)
       .using(select)
       .on(condition)
       .whenMatchedThenUpdate()
       .set(field1, value1)
       .set(field2, value2)
       .whenNotMatchedThenInsert(field1, field2)
       .values(value1, value2)
       .execute();
 

Note: Using this method, you can also create an H2-specific MERGE statement without field specification. See also FactoryOperations.mergeInto(Table, Field...)

Specified by:
mergeInto in interface FactoryOperations

mergeInto

public final <R extends Record> MergeKeyStep<R> mergeInto(Table<R> table,
                                                          Field<?>... fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL merge statement (H2-specific syntax)

This statement is available from DSL syntax only. It is known to be supported in some way by any of these dialects:

H2 H2 natively supports this special syntax www.h2database.com/html/grammar.html#merge
DB2, HSQLDB, Oracle, SQL Server, Sybase SQL Anywhere These databases can simulate the H2-specific MERGE statement using a standard SQL MERGE statement, without restrictions See FactoryOperations.mergeInto(Table) for the standard MERGE statement

Specified by:
mergeInto in interface FactoryOperations

mergeInto

public final <R extends Record> MergeKeyStep<R> mergeInto(Table<R> table,
                                                          Collection<? extends Field<?>> fields)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL merge statement (H2-specific syntax)

Specified by:
mergeInto in interface FactoryOperations
See Also:
FactoryOperations.mergeInto(Table, Field...)

deleteQuery

public final <R extends Record> DeleteQuery<R> deleteQuery(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DeleteQuery

Specified by:
deleteQuery in interface FactoryOperations
Parameters:
table - The table to delete data from
Returns:
The new DeleteQuery

delete

public final <R extends Record> DeleteWhereStep<R> delete(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL delete statement.

Example:

 Factory create = new Factory();

 create.delete(table)
       .where(field1.greaterThan(100))
       .execute();
 

Specified by:
delete in interface FactoryOperations

batch

public final Batch batch(Query... queries)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a set of queries in batch mode (without bind values).

This essentially runs the following logic:

 Statement s = connection.createStatement();

 for (Query query : queries) {
     s.addBatch(query.getSQL(true));
 }

 s.execute();
 

Specified by:
batch in interface FactoryOperations
See Also:
Statement.executeBatch()

batch

public final Batch batch(Collection<? extends Query> queries)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a set of queries in batch mode (without bind values).

This essentially runs the following logic:

 Statement s = connection.createStatement();

 for (Query query : queries) {
     s.addBatch(query.getSQL(true));
 }

 s.execute();
 

Specified by:
batch in interface FactoryOperations
See Also:
Statement.executeBatch()

batch

public final BatchBindStep batch(Query query)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a set of queries in batch mode (with bind values).

When running

 create.batch(query)
       .bind(valueA1, valueA2)
       .bind(valueB1, valueB2)
       .execute();
 

This essentially runs the following logic:

 Statement s = connection.prepareStatement(query.getSQL(false));

 for (Object[] bindValues : allBindValues) {
     for (Object bindValue : bindValues) {
         s.setXXX(bindValue);
     }

     s.addBatch();
 }

 s.execute();
 

Note: bind values will be inlined to a static batch query as in FactoryOperations.batch(Query...), if you choose to execute queries with Settings.getStatementType() == StatementType.STATIC_STATEMENT

Specified by:
batch in interface FactoryOperations
See Also:
Statement.executeBatch()

batchStore

public final Batch batchStore(UpdatableRecord<?>... records)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a set of INSERT and UPDATE queries in batch mode (with bind values).

This batch operation can be executed in two modes:

With Settings.getStatementType() == StatementType.PREPARED_STATEMENT (the default)

In this mode, record order is preserved as much as possible, as long as two subsequent records generate the same SQL (with bind variables). The number of executed batch operations corresponds to [number of distinct rendered SQL statements]. In the worst case, this corresponds to the number of total records.

The record type order is preserved in the way they are passed to this method. This is an example of how statements will be ordered:

 // Let's assume, odd numbers result in INSERTs and even numbers in UPDATES
 // Let's also assume a[n] are all of the same type, just as b[n], c[n]...
 int[] result = create.batchStore(a1, a2, a3, b1, a4, c1, b3, a5)
                      .execute();
 
The above results in result.length == 8 and the following 4 separate batch statements:
  1. INSERT a1, a3, a5
  2. UPDATE a2, a4
  3. INSERT b1, b3
  4. INSERT c1

With Settings.getStatementType() == StatementType.STATIC_STATEMENT

This mode may be better for large and complex batch store operations, as the order of records is preserved entirely, and jOOQ can guarantee that only a single batch statement is serialised to the database.

Specified by:
batchStore in interface FactoryOperations
See Also:
Statement.executeBatch()

batchStore

public final Batch batchStore(Collection<? extends UpdatableRecord<?>> records)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a set of INSERT and UPDATE queries in batch mode (with bind values).

Specified by:
batchStore in interface FactoryOperations
See Also:
FactoryOperations.batchStore(UpdatableRecord...), Statement.executeBatch()

truncate

public final <R extends Record> Truncate<R> truncate(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new DSL truncate statement.

Example:

 Factory create = new Factory();

 create.truncate(table)
       .execute();
 

Most dialects implement the TRUNCATE statement. If it is not supported, it is simulated using an equivalent DELETE statement. This is particularly true for these dialects:

Note, this statement is only supported in DSL mode. Immediate execution is omitted for future extensibility of this command.

Specified by:
truncate in interface FactoryOperations

newRecord

public final <R extends UDTRecord<R>> R newRecord(UDT<R> type)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new UDTRecord.

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
newRecord in interface FactoryOperations
Type Parameters:
R - The generic record type
Parameters:
type - The UDT describing records of type <R>
Returns:
The new record

newRecord

public final <R extends TableRecord<R>> R newRecord(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new Record that can be inserted into the corresponding table.

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
newRecord in interface FactoryOperations
Type Parameters:
R - The generic record type
Parameters:
table - The table holding records of type <R>
Returns:
The new record

newRecord

public final <R extends TableRecord<R>> R newRecord(Table<R> table,
                                                    Object source)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new pre-filled Record that can be inserted into the corresponding table.

This performs roughly the inverse operation of Record.into(Class)

The resulting record will have its internal "changed" flags set to true for all values. This means that UpdatableRecord.store() will perform an INSERT statement. If you wish to store the record using an UPDATE statement, use FactoryOperations.executeUpdate(UpdatableRecord) instead.

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
newRecord in interface FactoryOperations
Type Parameters:
R - The generic record type
Parameters:
table - The table holding records of type <R>
source - The source to be used to fill the new record
Returns:
The new record
See Also:
Record.from(Object), Record.into(Class)

fetch

public final Result<Record> fetch(ResultSet rs)
Deprecated. 
Description copied from interface: FactoryOperations
Fetch all data from a JDBC ResultSet and transform it to a jOOQ Result. After fetching all data, the JDBC ResultSet will be closed.

Use FactoryOperations.fetchLazy(ResultSet), to fetch one Record at a time, instead of load the entire ResultSet into a jOOQ Result at once.

Specified by:
fetch in interface FactoryOperations
Parameters:
rs - The JDBC ResultSet to fetch data from
Returns:
The resulting jOOQ Result

fetchLazy

public final Cursor<Record> fetchLazy(ResultSet rs)
Deprecated. 
Description copied from interface: FactoryOperations
Fetch all data from a JDBC ResultSet and transform it to a jOOQ Result. After fetching all data, the JDBC ResultSet will be closed.

Use FactoryOperations.fetch(ResultSet), to load the entire ResultSet into a jOOQ Result at once.

Specified by:
fetchLazy in interface FactoryOperations
Parameters:
rs - The JDBC ResultSet to fetch data from
Returns:
The resulting jOOQ Result

fetchFromCSV

public final Result<Record> fetchFromCSV(String string)
Deprecated. 
Description copied from interface: FactoryOperations
Fetch all data from a CSV string.

This is the same as calling fetchFromCSV(string, ',') and the inverse of calling Result.formatCSV(). The first row of the CSV data is required to hold field name information. Subsequent rows may contain data, which is interpreted as String. Use the various conversion methods to retrieve other data types from the Result:

Missing values result in null. Empty values result in empty Strings

Specified by:
fetchFromCSV in interface FactoryOperations
Parameters:
string - The CSV string
Returns:
The transformed result
See Also:
FactoryOperations.fetchFromCSV(String, char)

fetchFromCSV

public final Result<Record> fetchFromCSV(String string,
                                         char delimiter)
Deprecated. 
Description copied from interface: FactoryOperations
Fetch all data from a CSV string.

This is inverse of calling Result.formatCSV(char). The first row of the CSV data is required to hold field name information. Subsequent rows may contain data, which is interpreted as String. Use the various conversion methods to retrieve other data types from the Result:

Missing values result in null. Empty values result in empty Strings

Specified by:
fetchFromCSV in interface FactoryOperations
Parameters:
string - The CSV string
delimiter - The delimiter to expect between records
Returns:
The transformed result
See Also:
FactoryOperations.fetchFromCSV(String)

fetch

public final Result<Record> fetch(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL.

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetch in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetch

public final Result<Record> fetch(String sql,
                                  Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetch in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetch

public final Result<Record> fetch(String sql,
                                  QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL.

Unlike FactoryOperations.fetch(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 fetch("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
fetch in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
The results from the executed query

fetchLazy

public final Cursor<Record> fetchLazy(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL and "lazily" return the generated result.

The returned Cursor holds a reference to the executed PreparedStatement and the associated ResultSet. Data can be fetched (or iterated over) lazily, fetching records from the ResultSet one by one.

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchLazy in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetchLazy

public final Cursor<Record> fetchLazy(String sql,
                                      Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL and "lazily" return the generated result. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

The returned Cursor holds a reference to the executed PreparedStatement and the associated ResultSet. Data can be fetched (or iterated over) lazily, fetching records from the ResultSet one by one.

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchLazy in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetchLazy

public final Cursor<Record> fetchLazy(String sql,
                                      QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL and "lazily" return the generated result.

The returned Cursor holds a reference to the executed PreparedStatement and the associated ResultSet. Data can be fetched (or iterated over) lazily, fetching records from the ResultSet one by one.

Unlike FactoryOperations.fetchLazy(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 fetchLazy("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
fetchLazy in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
The results from the executed query

fetchMany

public final List<Result<Record>> fetchMany(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL, possibly returning several result sets

Example (Sybase ASE):

 String sql = "sp_help 'my_table'";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchMany in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetchMany

public final List<Result<Record>> fetchMany(String sql,
                                            Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL, possibly returning several result sets. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

Example (Sybase ASE):

 String sql = "sp_help 'my_table'";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchMany in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetchMany

public final List<Result<Record>> fetchMany(String sql,
                                            QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL, possibly returning several result sets.

Unlike FactoryOperations.fetchMany(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 fetchMany("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
fetchMany in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
The results from the executed query

fetchOne

public final Record fetchOne(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL.

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchOne in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
The results from the executed query. This is never null, even if the database returns no ResultSet

fetchOne

public final Record fetchOne(String sql,
                             Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
fetchOne in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
The results from the executed query. This may be null if the database returned no records

fetchOne

public final Record fetchOne(String sql,
                             QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL.

Unlike FactoryOperations.fetchOne(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 fetchOne("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
fetchOne in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
The results from the executed query. This may be null if the database returned no records

execute

public final int execute(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a query holding plain SQL.

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
execute in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
The results from the executed query

execute

public final int execute(String sql,
                         Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
execute in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
The results from the executed query

execute

public final int execute(String sql,
                         QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Execute a new query holding plain SQL.

Unlike FactoryOperations.execute(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 execute("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
execute in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
The results from the executed query

resultQuery

public final ResultQuery<Record> resultQuery(String sql)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL. There must not be any binding variables contained in the SQL

Use this method, when you want to take advantage of the many ways to fetch results in jOOQ, using ResultQuery. Some examples:

ResultQuery.fetchLazy() Open a cursor and fetch records one by one
ResultQuery.fetchInto(Class) Fetch records into a custom POJO (optionally annotated with JPA annotations)
ResultQuery.fetchInto(RecordHandler) Fetch records into a custom callback (similar to Spring's RowMapper)
ResultQuery.fetchLater() Fetch records of a long-running query asynchronously

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
resultQuery in interface FactoryOperations
Parameters:
sql - The SQL
Returns:
An executable query

resultQuery

public final ResultQuery<Record> resultQuery(String sql,
                                             Object... bindings)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL. There must be as many bind variables contained in the SQL, as passed in the bindings parameter

Use this method, when you want to take advantage of the many ways to fetch results in jOOQ, using ResultQuery. Some examples:

ResultQuery.fetchLazy() Open a cursor and fetch records one by one
ResultQuery.fetchInto(Class) Fetch records into a custom POJO (optionally annotated with JPA annotations)
ResultQuery.fetchInto(RecordHandler) Fetch records into a custom callback (similar to Spring's RowMapper)
ResultQuery.fetchLater() Fetch records of a long-running query asynchronously

Example (Postgres):

 String sql = "FETCH ALL IN \"\"";
Example (SQLite):

 String sql = "pragma table_info('my_table')";

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!

Specified by:
resultQuery in interface FactoryOperations
Parameters:
sql - The SQL
bindings - The bindings
Returns:
A query wrapping the plain SQL

resultQuery

public final ResultQuery<Record> resultQuery(String sql,
                                             QueryPart... parts)
Deprecated. 
Description copied from interface: FactoryOperations
Create a new query holding plain SQL.

Unlike FactoryOperations.resultQuery(String, Object...), the SQL passed to this method should not contain any bind variables. Instead, you can pass QueryPart objects to the method which will be rendered at indexed locations of your SQL string as such:

 // The following query
 resultQuery("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));

 // Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
 select ?, 'test' from "DUAL"
 

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses! One way to escape literals is to use Factory.name(String...) and similar methods

Specified by:
resultQuery in interface FactoryOperations
Parameters:
sql - The SQL clause, containing {numbered placeholders} where query parts can be injected
parts - The QueryPart objects that are rendered at the {numbered placeholder} locations
Returns:
A query wrapping the plain SQL

lastID

public final BigInteger lastID()
Deprecated. 
Description copied from interface: FactoryOperations
Retrieve the last inserted ID.

Note, there are some restrictions to the following dialects:

Specified by:
lastID in interface FactoryOperations
Returns:
The last inserted ID. This may be null in some dialects, if no such number is available.

nextval

public final <T extends Number> T nextval(Sequence<T> sequence)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to fetch the NEXTVAL for a sequence directly from this Factory's underlying JDBC Connection

Specified by:
nextval in interface FactoryOperations

currval

public final <T extends Number> T currval(Sequence<T> sequence)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to fetch the CURRVAL for a sequence directly from this Factory's underlying JDBC Connection

Specified by:
currval in interface FactoryOperations

use

public final int use(Schema schema)
Deprecated. 
Description copied from interface: FactoryOperations
Use a schema as the default schema of the underlying connection.

This has two effects.

  1. The USE [schema] statement is executed on those RDBMS that support this
  2. The supplied Schema is used as the default schema resulting in omitting that schema in rendered SQL.

The USE [schema] statement translates to the various dialects as follows:

Dialect Command
DB2 SET SCHEMA [schema]
Derby: SET SCHEMA [schema]
H2: SET SCHEMA [schema]
HSQLDB: SET SCHEMA [schema]
MySQL: USE [schema]
Oracle: ALTER SESSION SET CURRENT_SCHEMA = [schema]
Postgres: SET SEARCH_PATH = [schema]
Sybase: USE [schema]

Specified by:
use in interface FactoryOperations

use

public final int use(String schema)
Deprecated. 
Description copied from interface: FactoryOperations
Use a schema as the default schema of the underlying connection.

Specified by:
use in interface FactoryOperations
See Also:
FactoryOperations.use(Schema)

fetch

public final <R extends Record> Result<R> fetch(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Execute and return all records for
SELECT * FROM [table]

The result and its contained records are attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
fetch in interface FactoryOperations

fetch

public final <R extends Record> Result<R> fetch(Table<R> table,
                                                Condition condition)
Deprecated. 
Description copied from interface: FactoryOperations
Execute and return all records for
SELECT * FROM [table] WHERE [condition] 

The result and its contained records are attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
fetch in interface FactoryOperations

fetchOne

public final <R extends Record> R fetchOne(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Execute and return zero or one record for
SELECT * FROM [table]

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
fetchOne in interface FactoryOperations
Returns:
The record or null if no record was returned

fetchOne

public final <R extends Record> R fetchOne(Table<R> table,
                                           Condition condition)
Deprecated. 
Description copied from interface: FactoryOperations
Execute and return zero or one record for
SELECT * FROM [table] WHERE [condition] 

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
fetchOne in interface FactoryOperations
Returns:
The record or null if no record was returned

fetchAny

public final <R extends Record> R fetchAny(Table<R> table)
Deprecated. 
Description copied from interface: FactoryOperations
Execute and return zero or one record for
SELECT * FROM [table] LIMIT 1

The resulting record is attached to this Configuration by default. Use Settings.isAttachRecords() to override this behaviour.

Specified by:
fetchAny in interface FactoryOperations
Returns:
The record or null if no record was returned

executeInsert

@Deprecated
public final <R extends TableRecord<R>> int executeInsert(Table<R> table,
                                                                     R record)
Deprecated. 

Description copied from interface: FactoryOperations
Insert one record
INSERT INTO [table] ... VALUES [record] 

Specified by:
executeInsert in interface FactoryOperations
Returns:
The number of inserted records

executeInsert

public final <R extends TableRecord<R>> int executeInsert(R record)
Deprecated. 
Description copied from interface: FactoryOperations
Insert one record

This executes something like the following statement:

INSERT INTO [table] ... VALUES [record] 

Unlike UpdatableRecord.store(), this does not change any of the argument record's internal "changed" flags, such that a subsequent call to UpdatableRecord.store() might lead to another INSERT statement being executed.

Specified by:
executeInsert in interface FactoryOperations
Returns:
The number of inserted records

executeUpdate

@Deprecated
public final <R extends TableRecord<R>> int executeUpdate(Table<R> table,
                                                                     R record)
Deprecated. 

Description copied from interface: FactoryOperations
Update a table
UPDATE [table] SET [modified values in record] 

Specified by:
executeUpdate in interface FactoryOperations
Returns:
The number of updated records

executeUpdate

@Deprecated
public final <R extends TableRecord<R>,T> int executeUpdate(Table<R> table,
                                                                       R record,
                                                                       Condition condition)
Deprecated. 

Description copied from interface: FactoryOperations
Update a table
UPDATE [table] SET [modified values in record] WHERE [condition]

Specified by:
executeUpdate in interface FactoryOperations
Returns:
The number of updated records

executeUpdateOne

@Deprecated
public final <R extends TableRecord<R>> int executeUpdateOne(Table<R> table,
                                                                        R record)
Deprecated. 

Description copied from interface: FactoryOperations
Update one record in a table
UPDATE [table] SET [modified values in record]

Specified by:
executeUpdateOne in interface FactoryOperations
Returns:
The number of updated records

executeUpdateOne

@Deprecated
public final <R extends TableRecord<R>,T> int executeUpdateOne(Table<R> table,
                                                                          R record,
                                                                          Condition condition)
Deprecated. 

Description copied from interface: FactoryOperations
Update one record in a table
UPDATE [table] SET [modified values in record] WHERE [condition]

Specified by:
executeUpdateOne in interface FactoryOperations
Returns:
The number of updated records

executeUpdate

public final <R extends UpdatableRecord<R>> int executeUpdate(R record)
Deprecated. 
Description copied from interface: FactoryOperations
Update a table
UPDATE [table] SET [modified values in record] WHERE [record is supplied record] 

Specified by:
executeUpdate in interface FactoryOperations
Returns:
The number of updated records

executeUpdate

public final <R extends TableRecord<R>,T> int executeUpdate(R record,
                                                            Condition condition)
Deprecated. 
Description copied from interface: FactoryOperations
Update a table
UPDATE [table] SET [modified values in record] WHERE [condition]

Specified by:
executeUpdate in interface FactoryOperations
Returns:
The number of updated records

executeDelete

public final <R extends UpdatableRecord<R>> int executeDelete(R record)
Deprecated. 
Description copied from interface: FactoryOperations
Delete a record from a table
DELETE FROM [table] WHERE [record is supplied record]

Specified by:
executeDelete in interface FactoryOperations
Returns:
The number of deleted records

executeDelete

public final <R extends TableRecord<R>,T> int executeDelete(R record,
                                                            Condition condition)
Deprecated. 
Description copied from interface: FactoryOperations
Delete a record from a table
DELETE FROM [table] WHERE [condition]

Specified by:
executeDelete in interface FactoryOperations
Returns:
The number of deleted records

executeDelete

@Deprecated
public final <R extends TableRecord<R>> int executeDelete(Table<R> table)
Deprecated. 

Description copied from interface: FactoryOperations
Delete records from a table
DELETE FROM [table]

Specified by:
executeDelete in interface FactoryOperations
Returns:
The number of deleted records

executeDelete

@Deprecated
public final <R extends TableRecord<R>,T> int executeDelete(Table<R> table,
                                                                       Condition condition)
Deprecated. 

Description copied from interface: FactoryOperations
Delete records from a table
DELETE FROM [table] WHERE [condition]

Specified by:
executeDelete in interface FactoryOperations
Returns:
The number of deleted records

executeDeleteOne

@Deprecated
public final <R extends TableRecord<R>> int executeDeleteOne(Table<R> table)
Deprecated. 

Description copied from interface: FactoryOperations
Delete one record in a table
DELETE FROM [table]

Specified by:
executeDeleteOne in interface FactoryOperations
Returns:
The number of deleted records

executeDeleteOne

@Deprecated
public final <R extends TableRecord<R>,T> int executeDeleteOne(Table<R> table,
                                                                          Condition condition)
Deprecated. 

Description copied from interface: FactoryOperations
Delete one record in a table
DELETE FROM [table] WHERE [condition]

Specified by:
executeDeleteOne in interface FactoryOperations
Returns:
The number of deleted records

getTransactionIsolation

public final int getTransactionIsolation()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.getTransactionIsolation()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
getTransactionIsolation in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

setTransactionIsolation

public final void setTransactionIsolation(int level)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.setTransactionIsolation(int)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
setTransactionIsolation in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

getHoldability

public final int getHoldability()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.getHoldability()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
getHoldability in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

setHoldability

public final void setHoldability(int holdability)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.setHoldability(int)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
setHoldability in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

getAutoCommit

public final boolean getAutoCommit()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.getAutoCommit()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
getAutoCommit in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

setAutoCommit

public final void setAutoCommit(boolean autoCommit)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.setAutoCommit(boolean)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
setAutoCommit in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

releaseSavepoint

public final void releaseSavepoint(Savepoint savepoint)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.releaseSavepoint(Savepoint)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
releaseSavepoint in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

setSavepoint

public final Savepoint setSavepoint(String name)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.setSavepoint(String)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
setSavepoint in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

setSavepoint

public final Savepoint setSavepoint()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.setSavepoint()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
setSavepoint in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

rollback

public final void rollback(Savepoint savepoint)
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.rollback(Savepoint)

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
rollback in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

rollback

public final void rollback()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.rollback()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
rollback in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)

commit

public final void commit()
Deprecated. 
Description copied from interface: FactoryOperations
Convenience method to access Connection.commit()

Use this method only if you control the JDBC Connection wrapped by this Configuration, and if that connection manages the current transaction. If your transaction is operated on a distributed javax.transaction.UserTransaction, for instance, this method will not work.

Specified by:
commit in interface FactoryOperations
See Also:
Configuration.setConnection(Connection), Configuration.setDataSource(DataSource)


Copyright © 2012. All Rights Reserved.