Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.id
Class SelectGenerator  view SelectGenerator download SelectGenerator.java

java.lang.Object
  extended byorg.hibernate.id.AbstractPostInsertGenerator
      extended byorg.hibernate.id.SelectGenerator
All Implemented Interfaces:
Configurable, IdentifierGenerator, PostInsertIdentifierGenerator

public class SelectGenerator
extends AbstractPostInsertGenerator
implements Configurable

A generator that selects the just inserted row to determine the identifier value assigned by the database. The correct row is located using a unique key.

One mapping parameter is required: key (unless a natural-id is defined in the mapping).


Nested Class Summary
static class SelectGenerator.SelectGeneratorDelegate
          The delegate for the select generation strategy.
 
Field Summary
private  java.lang.String uniqueKeyPropertyName
           
 
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME
 
Constructor Summary
SelectGenerator()
           
 
Method Summary
 void configure(org.hibernate.type.Type type, java.util.Properties params, org.hibernate.dialect.Dialect d)
          Configure this instance, given the value of parameters specified by the user as <param> elements.
private static java.lang.String determineNameOfPropertyToUse(PostInsertIdentityPersister persister, java.lang.String supplied)
           
 org.hibernate.id.insert.InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, org.hibernate.dialect.Dialect dialect, boolean isGetGeneratedKeysEnabled)
           
 
Methods inherited from class org.hibernate.id.AbstractPostInsertGenerator
generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uniqueKeyPropertyName

private java.lang.String uniqueKeyPropertyName
Constructor Detail

SelectGenerator

public SelectGenerator()
Method Detail

configure

public void configure(org.hibernate.type.Type type,
                      java.util.Properties params,
                      org.hibernate.dialect.Dialect d)
               throws org.hibernate.MappingException
Description copied from interface: Configurable
Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.

Specified by:
configure in interface Configurable

getInsertGeneratedIdentifierDelegate

public org.hibernate.id.insert.InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister,
                                                                                                      org.hibernate.dialect.Dialect dialect,
                                                                                                      boolean isGetGeneratedKeysEnabled)
                                                                                               throws org.hibernate.HibernateException
Specified by:
getInsertGeneratedIdentifierDelegate in interface PostInsertIdentifierGenerator

determineNameOfPropertyToUse

private static java.lang.String determineNameOfPropertyToUse(PostInsertIdentityPersister persister,
                                                             java.lang.String supplied)