Package org.hibernate.id
Class IdentityGenerator.BasicDelegate
- java.lang.Object
-
- org.hibernate.id.insert.AbstractSelectingDelegate
-
- org.hibernate.id.IdentityGenerator.BasicDelegate
-
- All Implemented Interfaces:
InsertGeneratedIdentifierDelegate
- Enclosing class:
- IdentityGenerator
public static class IdentityGenerator.BasicDelegate extends AbstractSelectingDelegate implements InsertGeneratedIdentifierDelegate
Delegate for dealing with IDENTITY columns where the dialect requires an additional command execution to retrieve the generated IDENTITY value
-
-
Constructor Summary
Constructors Constructor Description BasicDelegate(PostInsertIdentityPersister persister, Dialect dialect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.Serializable
getResult(SharedSessionContractImplementor session, java.sql.ResultSet rs, java.lang.Object object)
Extract the generated key value from the given result set.protected java.lang.String
getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.IdentifierGeneratingInsert
prepareIdentifierGeneratingInsert(SqlStringGenerationContext context)
Build aInsert
specific to the delegate's mode of handling generated key values.-
Methods inherited from class org.hibernate.id.insert.AbstractSelectingDelegate
bindParameters, 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
-
-
-
-
Constructor Detail
-
BasicDelegate
public BasicDelegate(PostInsertIdentityPersister persister, Dialect dialect)
-
-
Method Detail
-
prepareIdentifierGeneratingInsert
public IdentifierGeneratingInsert prepareIdentifierGeneratingInsert(SqlStringGenerationContext context)
Description copied from interface:InsertGeneratedIdentifierDelegate
Build aInsert
specific to the delegate's mode of handling generated key values.- Specified by:
prepareIdentifierGeneratingInsert
in interfaceInsertGeneratedIdentifierDelegate
- Parameters:
context
- A context to help generate SQL strings- Returns:
- The insert object.
-
getSelectSQL
protected java.lang.String getSelectSQL()
Description copied from class:AbstractSelectingDelegate
Get the SQL statement to be used to retrieve generated key values.- Specified by:
getSelectSQL
in classAbstractSelectingDelegate
- Returns:
- The SQL command string
-
getResult
protected java.io.Serializable getResult(SharedSessionContractImplementor session, java.sql.ResultSet rs, java.lang.Object object) throws java.sql.SQLException
Description copied from class:AbstractSelectingDelegate
Extract the generated key value from the given result set.- Specified by:
getResult
in classAbstractSelectingDelegate
- Parameters:
session
- The sessionrs
- The result set containing the generated primay key values.object
- The entity being saved.- Returns:
- The generated identifier
- Throws:
java.sql.SQLException
-
-