Package org.hibernate.id
Class SelectGenerator.SelectGeneratorDelegate
- java.lang.Object
-
- org.hibernate.id.insert.AbstractSelectingDelegate
-
- org.hibernate.id.SelectGenerator.SelectGeneratorDelegate
-
- All Implemented Interfaces:
InsertGeneratedIdentifierDelegate
- Enclosing class:
- SelectGenerator
public static class SelectGenerator.SelectGeneratorDelegate extends AbstractSelectingDelegate implements InsertGeneratedIdentifierDelegate
The delegate for the select generation strategy.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbindParameters(SharedSessionContractImplementor session, java.sql.PreparedStatement ps, java.lang.Object entity)Bind any required parameter values into the SQL commandAbstractSelectingDelegate.getSelectSQL().protected java.io.SerializablegetResult(SharedSessionContractImplementor session, java.sql.ResultSet rs, java.lang.Object entity)Extract the generated key value from the given result set.protected java.lang.StringgetSelectSQL()Get the SQL statement to be used to retrieve generated key values.IdentifierGeneratingInsertprepareIdentifierGeneratingInsert(SqlStringGenerationContext context)Build aInsertspecific to the delegate's mode of handling generated key values.-
Methods inherited from class org.hibernate.id.insert.AbstractSelectingDelegate
performInsert
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.id.insert.InsertGeneratedIdentifierDelegate
performInsert, prepareIdentifierGeneratingInsert
-
-
-
-
Method Detail
-
prepareIdentifierGeneratingInsert
public IdentifierGeneratingInsert prepareIdentifierGeneratingInsert(SqlStringGenerationContext context)
Description copied from interface:InsertGeneratedIdentifierDelegateBuild aInsertspecific to the delegate's mode of handling generated key values.- Specified by:
prepareIdentifierGeneratingInsertin interfaceInsertGeneratedIdentifierDelegate- Parameters:
context- A context to help generate SQL strings- Returns:
- The insert object.
-
getSelectSQL
protected java.lang.String getSelectSQL()
Description copied from class:AbstractSelectingDelegateGet the SQL statement to be used to retrieve generated key values.- Specified by:
getSelectSQLin classAbstractSelectingDelegate- Returns:
- The SQL command string
-
bindParameters
protected void bindParameters(SharedSessionContractImplementor session, java.sql.PreparedStatement ps, java.lang.Object entity) throws java.sql.SQLException
Description copied from class:AbstractSelectingDelegateBind any required parameter values into the SQL commandAbstractSelectingDelegate.getSelectSQL().- Overrides:
bindParametersin classAbstractSelectingDelegate- Parameters:
session- The sessionps- The preparedSQLcommandentity- The entity being saved.- Throws:
java.sql.SQLException
-
getResult
protected java.io.Serializable getResult(SharedSessionContractImplementor session, java.sql.ResultSet rs, java.lang.Object entity) throws java.sql.SQLException
Description copied from class:AbstractSelectingDelegateExtract the generated key value from the given result set.- Specified by:
getResultin classAbstractSelectingDelegate- Parameters:
session- The sessionrs- The result set containing the generated primay key values.entity- The entity being saved.- Returns:
- The generated identifier
- Throws:
java.sql.SQLException
-
-