Top Description Methods
org.hibernate.engine.jdbc.spi

public Interface MutationStatementPreparer

Known Direct Implementers
org.hibernate.engine.jdbc.internal.MutationStatementPreparerImpl
Imports
java.sql.PreparedStatement

Interface to the object that prepares JDBC PreparedStatements related to mutations on behalf of a JdbcCoordinator.
Author
Steve Ebersole
See Also
JdbcCoordinator#getMutationStatementPreparer()

Method Summary

Modifier and TypeMethod and Description
public PreparedStatement

Returns:

the prepared statement
prepareStatement
(String
The SQL the statement to be prepared
sql
,
boolean
Whether to prepare as a callable statement.
isCallable
)

Prepare a statement.

public PreparedStatement

Returns:

the prepared statement
prepareStatement
(String
The INSERT SQL
sql
,
int
The autoGeneratedKeys flag
autoGeneratedKeys
)

Prepare an INSERT statement, specifying how auto-generated (by the database) keys should be handled.

public PreparedStatement

Returns:

the prepared statement
prepareStatement
(String
- the SQL for the statement to be prepared
sql
,
String[]
The name of the columns to be returned in the generated keys result set.
columnNames
)

Prepare an INSERT statement, specifying columns which are auto-generated values to be returned.

Method Detail

prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, boolean isCallable)

Prepare a statement.

Parameters
sql:String

The SQL the statement to be prepared

isCallable:boolean

Whether to prepare as a callable statement.

Returns:PreparedStatement

the prepared statement

prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)

Prepare an INSERT statement, specifying how auto-generated (by the database) keys should be handled. Really this is a boolean, but JDBC opted to define it instead using 2 int constants:

Generated keys are accessed afterwards via PreparedStatement#getGeneratedKeys

Parameters
sql:String

The INSERT SQL

autoGeneratedKeys:int

The autoGeneratedKeys flag

Returns:PreparedStatement

the prepared statement

See Also
java.sql.Connection#prepareStatement(String, int)
prepareStatementback to summary
public PreparedStatement prepareStatement(String sql, String[] columnNames)

Prepare an INSERT statement, specifying columns which are auto-generated values to be returned. Generated keys are accessed afterwards via PreparedStatement#getGeneratedKeys

Parameters
sql:String

- the SQL for the statement to be prepared

columnNames:String[]

The name of the columns to be returned in the generated keys result set.

Returns:PreparedStatement

the prepared statement

See Also
java.sql.Connection#prepareStatement(String, String[])