org.hibernate.id

Class SelectGenerator.SelectGeneratorDelegate

Enclosing Class:
SelectGenerator
Implemented Interfaces:
InsertGeneratedIdentifierDelegate

public static class SelectGenerator.SelectGeneratorDelegate
extends AbstractSelectingDelegate
implements InsertGeneratedIdentifierDelegate

The delegate for the select generation strategy.

Method Summary

protected void
bindParameters(SessionImplementor session, PreparedStatement ps, Object entity)
Bind any required parameter values into the SQL command AbstractSelectingDelegate.getSelectSQL().
protected Serializable
getResult(SessionImplementor session, ResultSet rs, Object entity)
Extract the generated key value from the given result set.
protected String
getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.
IdentifierGeneratingInsert
prepareIdentifierGeneratingInsert()

Methods inherited from class org.hibernate.id.insert.AbstractSelectingDelegate

bindParameters, getResult, getSelectSQL, performInsert

Method Details

bindParameters

protected void bindParameters(SessionImplementor session,
                              PreparedStatement ps,
                              Object entity)
            throws SQLException
Bind any required parameter values into the SQL command AbstractSelectingDelegate.getSelectSQL().
Overrides:
bindParameters in interface AbstractSelectingDelegate
Parameters:
session - The session
ps - The prepared SQL command
entity - The entity being saved.

getResult

protected Serializable getResult(SessionImplementor session,
                                 ResultSet rs,
                                 Object entity)
            throws SQLException
Extract the generated key value from the given result set.
Overrides:
getResult in interface AbstractSelectingDelegate
Parameters:
session - The session
rs - The result set containing the generated primay key values.
entity - The entity being saved.
Returns:
The generated identifier

getSelectSQL

protected String getSelectSQL()
Get the SQL statement to be used to retrieve generated key values.
Overrides:
getSelectSQL in interface AbstractSelectingDelegate
Returns:
The SQL command string

prepareIdentifierGeneratingInsert

public IdentifierGeneratingInsert prepareIdentifierGeneratingInsert()
Specified by:
prepareIdentifierGeneratingInsert in interface InsertGeneratedIdentifierDelegate