Class MutationStatementPreparerImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.internal.MutationStatementPreparerImpl
-
- All Implemented Interfaces:
MutationStatementPreparer
public class MutationStatementPreparerImpl extends Object implements MutationStatementPreparer
-
-
Constructor Summary
Constructors Constructor Description MutationStatementPreparerImpl(JdbcCoordinatorImpl jdbcCoordinator, JdbcServices jdbcServices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Connectionconnection()protected LogicalConnectionImplementorlogicalConnection()PreparedStatementprepareStatement(String sql, boolean isCallable)Prepare a statement.PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)Prepare an INSERT statement, specifying how auto-generated (by the database) keys should be handled.PreparedStatementprepareStatement(String sql, String[] columnNames)Prepare an INSERT statement, specifying columns which are auto-generated values to be returned.protected JdbcSessionContextsettings()protected SqlExceptionHelpersqlExceptionHelper()
-
-
-
Constructor Detail
-
MutationStatementPreparerImpl
public MutationStatementPreparerImpl(JdbcCoordinatorImpl jdbcCoordinator, JdbcServices jdbcServices)
-
-
Method Detail
-
prepareStatement
public PreparedStatement prepareStatement(String sql, boolean isCallable)
Description copied from interface:MutationStatementPreparerPrepare a statement.- Specified by:
prepareStatementin interfaceMutationStatementPreparer- Parameters:
sql- The SQL the statement to be preparedisCallable- Whether to prepare as a callable statement.- Returns:
- the prepared statement
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
Description copied from interface:MutationStatementPreparerPrepare 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
Statement.getGeneratedKeys()- Specified by:
prepareStatementin interfaceMutationStatementPreparer- Parameters:
sql- The INSERT SQLautoGeneratedKeys- The autoGeneratedKeys flag- Returns:
- the prepared statement
- See Also:
Connection.prepareStatement(String, int)
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames)
Description copied from interface:MutationStatementPreparerPrepare an INSERT statement, specifying columns which are auto-generated values to be returned. Generated keys are accessed afterwards viaStatement.getGeneratedKeys()- Specified by:
prepareStatementin interfaceMutationStatementPreparer- Parameters:
sql- - the SQL for the statement to be preparedcolumnNames- The name of the columns to be returned in the generated keys result set.- Returns:
- the prepared statement
- See Also:
Connection.prepareStatement(String, String[])
-
connection
protected final Connection connection()
-
logicalConnection
protected final LogicalConnectionImplementor logicalConnection()
-
sqlExceptionHelper
protected final SqlExceptionHelper sqlExceptionHelper()
-
settings
protected final JdbcSessionContext settings()
-
-