org.hibernate.id
Class AbstractPostInsertGenerator

java.lang.Object
  extended by org.hibernate.id.AbstractPostInsertGenerator
All Implemented Interfaces:
BulkInsertionCapableIdentifierGenerator, IdentifierGenerator, PostInsertIdentifierGenerator
Direct Known Subclasses:
IdentityGenerator, SelectGenerator

public abstract class AbstractPostInsertGenerator
extends Object
implements PostInsertIdentifierGenerator, BulkInsertionCapableIdentifierGenerator

Basic implementation of the PostInsertIdentifierGenerator contract.


Field Summary
 
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, JPA_ENTITY_NAME
 
Constructor Summary
AbstractPostInsertGenerator()
           
 
Method Summary
 String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
          Return the select expression fragment, if any, that generates the identifier values.
 Serializable generate(SessionImplementor s, Object obj)
          Generate a new identifier.
 boolean supportsBulkInsertionIdentifierGeneration()
          Given the configuration of this generator, is identifier generation as part of bulk insertion supported?

IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which *can* support this based on configuration

 
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.PostInsertIdentifierGenerator
getInsertGeneratedIdentifierDelegate
 

Constructor Detail

AbstractPostInsertGenerator

public AbstractPostInsertGenerator()
Method Detail

generate

public Serializable generate(SessionImplementor s,
                             Object obj)
Description copied from interface: IdentifierGenerator
Generate a new identifier.

Specified by:
generate in interface IdentifierGenerator
obj - the entity or toplevel collection for which the id is being generated
Returns:
a new identifier

supportsBulkInsertionIdentifierGeneration

public boolean supportsBulkInsertionIdentifierGeneration()
Description copied from interface: BulkInsertionCapableIdentifierGenerator
Given the configuration of this generator, is identifier generation as part of bulk insertion supported?

IMPL NOTE : Mainly here to allow stuff like SequenceStyleGenerator which *can* support this based on configuration

Specified by:
supportsBulkInsertionIdentifierGeneration in interface BulkInsertionCapableIdentifierGenerator
Returns:
true if bulk insertions are supported; false otherwise.

determineBulkInsertionIdentifierGenerationSelectFragment

public String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
Description copied from interface: BulkInsertionCapableIdentifierGenerator
Return the select expression fragment, if any, that generates the identifier values.

Specified by:
determineBulkInsertionIdentifierGenerationSelectFragment in interface BulkInsertionCapableIdentifierGenerator
Parameters:
dialect - The dialect against which the insert will be performed.
Returns:
The identifier value generation fragment (SQL). null indicates that no fragment is needed.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.