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;
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, TABLES
ENTITY_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() |
public 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 Configurable
MappingException
public boolean supportsBulkInsertionIdentifierGeneration()
supportsBulkInsertionIdentifierGeneration
in interface BulkInsertionCapableIdentifierGenerator
public String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect)
determineBulkInsertionIdentifierGenerationSelectFragment
in interface BulkInsertionCapableIdentifierGenerator
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
generate
in interface IdentifierGenerator
HibernateException
public 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 PersistentIdentifierGenerator
public void registerExportables(Database database)
registerExportables
in interface ExportableProducer
Copyright © 2017. All rights reserved.