public class BatchSequenceGenerator extends Object implements BulkInsertionCapableIdentifierGenerator, PersistentIdentifierGenerator, Configurable
WITH RECURSIVE t(n, level_num) AS (
SELECT nextval(seq_xxx) as n, 1 as level_num
UNION ALL
SELECT nextval(seq_xxx) as n, level_num + 1 as level_num
FROM t
WHERE level_num < ?)
SELECT n
FROM t;
WITH t(n) AS (
SELECT 1 as n
FROM (VALUES 1)
UNION ALL
SELECT n + 1 as n
FROM t
WHERE n < ?)
SELECT next value for SEQ_CHILD_ID as n
FROM t;
SELECT next value for seq_parent_id
FROM UNNEST(SEQUENCE_ARRAY(1, ?, 1));
SELECT seq_xxx.nextval
FROM dual
CONNECT BY rownum <= ?
WITH t(n) AS (
SELECT 1 as n
UNION ALL
SELECT n + 1 as n
FROM t
WHERE n < ?)
SELECT NEXT VALUE FOR seq_xxx as n
FROM t
WITH RECURSIVE t(n, level_num) AS (
SELECT NEXT VALUE FOR seq_xxx as n, 1 as level_num
FROM rdb$database
UNION ALL
SELECT NEXT VALUE FOR seq_xxx as n, level_num + 1 as level_num
FROM t
WHERE level_num < ?)
SELECT n
FROM t
WITH RECURSIVE and
sequences is supported.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FETCH_SIZE
The default value for
FETCH_SIZE_PARAM. |
static String |
FETCH_SIZE_PARAM
Indicates how many sequence values to fetch at once.
|
static String |
SEQUENCE_PARAM
Indicates the name of the sequence to use, mandatory.
|
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLESENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME| Constructor and Description |
|---|
BatchSequenceGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Type type,
Properties params,
ServiceRegistry serviceRegistry) |
String |
determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect) |
Serializable |
generate(SharedSessionContractImplementor session,
Object object) |
Object |
generatorKey() |
void |
registerExportables(Database database) |
String[] |
sqlCreateStrings(Dialect dialect)
Deprecated.
|
String[] |
sqlDropStrings(Dialect dialect)
Deprecated.
|
boolean |
supportsBulkInsertionIdentifierGeneration() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsupportsJdbcBatchInsertspublic static final String SEQUENCE_PARAM
public static final String FETCH_SIZE_PARAM
DEFAULT_FETCH_SIZE.public static final int DEFAULT_FETCH_SIZE
FETCH_SIZE_PARAM.public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
configure in interface ConfigurableMappingExceptionpublic boolean supportsBulkInsertionIdentifierGeneration()
supportsBulkInsertionIdentifierGeneration in interface BulkInsertionCapableIdentifierGeneratorpublic String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
determineBulkInsertionIdentifierGenerationSelectFragment in interface BulkInsertionCapableIdentifierGeneratorpublic Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
generate in interface IdentifierGeneratorHibernateExceptionpublic Object generatorKey()
generatorKey in interface PersistentIdentifierGenerator@Deprecated public String[] sqlCreateStrings(Dialect dialect)
sqlCreateStrings in interface PersistentIdentifierGenerator@Deprecated public String[] sqlDropStrings(Dialect dialect)
sqlDropStrings in interface PersistentIdentifierGeneratorpublic void registerExportables(Database database)
registerExportables in interface ExportableProducerCopyright © 2017–2020. All rights reserved.