站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 3.2.3 正式版 API 英文文档

SelectGenerator.SelectGeneratorDelegate (Hibernate API Documentation) - Hibernate 3.2.3 正式版 API 英文文档


org.hibernate.id
Class SelectGenerator.SelectGeneratorDelegate

java.lang.Object
  extended byorg.hibernate.id.insert.AbstractSelectingDelegate
      extended byorg.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
protected  void bindParameters(SessionImplementor session, PreparedStatement ps, Object entity)
          Bind any required parameter values into the SQL command 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()
          Build a Insert specific 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
 

Method Detail

prepareIdentifierGeneratingInsert

public IdentifierGeneratingInsert prepareIdentifierGeneratingInsert()
Description copied from interface: InsertGeneratedIdentifierDelegate
Build a Insert specific to the delegate's mode of handling generated key values.

Specified by:
prepareIdentifierGeneratingInsert in interface InsertGeneratedIdentifierDelegate
Returns:
The insert object.

getSelectSQL

protected String getSelectSQL()
Description copied from class: AbstractSelectingDelegate
Get the SQL statement to be used to retrieve generated key values.

Specified by:
getSelectSQL in class AbstractSelectingDelegate
Returns:
The SQL command string

bindParameters

protected void bindParameters(SessionImplementor session,
                              PreparedStatement ps,
                              Object entity)
                       throws SQLException
Description copied from class: AbstractSelectingDelegate
Bind any required parameter values into the SQL command AbstractSelectingDelegate.getSelectSQL().

Overrides:
bindParameters in class AbstractSelectingDelegate
Parameters:
session - The session
ps - The prepared SQL command
entity - The entity being saved.
Throws:
SQLException

getResult

protected Serializable getResult(SessionImplementor session,
                                 ResultSet rs,
                                 Object entity)
                          throws SQLException
Description copied from class: AbstractSelectingDelegate
Extract the generated key value from the given result set.

Specified by:
getResult in class AbstractSelectingDelegate
Parameters:
session - The session
rs - The result set containing the generated primay key values.
entity - The entity being saved.
Returns:
The generated identifier
Throws:
SQLException