Package org.hibernate.id
Class SelectGenerator
- java.lang.Object
-
- org.hibernate.id.AbstractPostInsertGenerator
-
- org.hibernate.id.SelectGenerator
-
- All Implemented Interfaces:
ExportableProducer
,BulkInsertionCapableIdentifierGenerator
,Configurable
,IdentifierGenerator
,PostInsertIdentifierGenerator
public class SelectGenerator extends AbstractPostInsertGenerator
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
Nested Classes Modifier and Type Class Description static class
SelectGenerator.SelectGeneratorDelegate
The delegate for the select generation strategy.
-
Field Summary
-
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
Constructor Summary
Constructors Constructor Description SelectGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry)
Configure this instance, given the value of parameters specified by the user as <param> elements.InsertGeneratedIdentifierDelegate
getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, Dialect dialect, boolean isGetGeneratedKeysEnabled)
-
Methods inherited from class org.hibernate.id.AbstractPostInsertGenerator
determineBulkInsertionIdentifierGenerationSelectFragment, generate, supportsBulkInsertionIdentifierGeneration
-
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.BulkInsertionCapableIdentifierGenerator
determineBulkInsertionIdentifierGenerationSelectFragment
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
initialize, registerExportables
-
Methods inherited from interface org.hibernate.id.PostInsertIdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
Method Detail
-
configure
public void configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry) throws MappingException
Description copied from interface:IdentifierGenerator
Configure this instance, given the value of parameters specified by the user as <param> elements.This method is called just once, following instantiation, and before
IdentifierGenerator.registerExportables(Database)
.- Parameters:
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
- If configuration fails.
-
getInsertGeneratedIdentifierDelegate
public InsertGeneratedIdentifierDelegate getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, Dialect dialect, boolean isGetGeneratedKeysEnabled) throws HibernateException
- Throws:
HibernateException
-
-