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

Quick Search    Search Deep

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

java.lang.Object
  extended byorg.hibernate.id.SequenceGenerator
      extended byorg.hibernate.id.SequenceIdentityGenerator
All Implemented Interfaces:
Configurable, IdentifierGenerator, PersistentIdentifierGenerator, PostInsertIdentifierGenerator

public class SequenceIdentityGenerator
extends SequenceGenerator
implements PostInsertIdentifierGenerator

A generator which combines sequence generation with immediate retrieval through JDBC3 getGeneratedKeys 55 . In this respect it works much like ANSI-SQL IDENTITY generation.

This generator only known to work with newer Oracle drivers compiled for JDK 1.4 (JDBC3).

Note: Due to a bug in Oracle drivers, sql comments on these insert statements are completely disabled.


Nested Class Summary
static class SequenceIdentityGenerator.Delegate
           
static class SequenceIdentityGenerator.NoCommentsInsert
           
 
Field Summary
private static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.hibernate.id.SequenceGenerator
PARAMETERS, SEQUENCE
 
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME
 
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, PK, SCHEMA, SQL, TABLE, TABLES
 
Constructor Summary
SequenceIdentityGenerator()
           
 
Method Summary
 void configure(org.hibernate.type.Type type, java.util.Properties params, org.hibernate.dialect.Dialect dialect)
          Configure this instance, given the value of parameters specified by the user as <param> elements.
 java.io.Serializable generate(org.hibernate.engine.SessionImplementor s, java.lang.Object obj)
          Generate a new identifier.
 org.hibernate.id.insert.InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, org.hibernate.dialect.Dialect dialect, boolean isGetGeneratedKeysEnabled)
           
 
Methods inherited from class org.hibernate.id.SequenceGenerator
generatorKey, getSequenceName, sqlCreateStrings, sqlDropStrings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Constructor Detail

SequenceIdentityGenerator

public SequenceIdentityGenerator()
Method Detail

generate

public java.io.Serializable generate(org.hibernate.engine.SessionImplementor s,
                                     java.lang.Object obj)
Description copied from interface: IdentifierGenerator
Generate a new identifier.

Specified by:
generate in interface IdentifierGenerator
Overrides:
generate in class SequenceGenerator

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

configure

public void configure(org.hibernate.type.Type type,
                      java.util.Properties params,
                      org.hibernate.dialect.Dialect dialect)
               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
Overrides:
configure in class SequenceGenerator