Skip to content

Commit 1afcae2

Browse files
yrodierebeikov
authored andcommitted
HHH-15069 Fix backwards-incompatible changes for implementors of BulkInsertionCapableIdentifierGenerator
1 parent 97f8732 commit 1afcae2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

hibernate-core/src/main/java/org/hibernate/id/BulkInsertionCapableIdentifierGenerator.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package org.hibernate.id;
88

99
import org.hibernate.boot.model.relational.SqlStringGenerationContext;
10+
import org.hibernate.dialect.Dialect;
1011

1112
/**
1213
* Specialized contract for {@link IdentifierGenerator} implementations capable of being used in conjunction
@@ -32,5 +33,18 @@ public interface BulkInsertionCapableIdentifierGenerator extends IdentifierGener
3233
*
3334
* @return The identifier value generation fragment (SQL). {@code null} indicates that no fragment is needed.
3435
*/
35-
public String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context);
36+
default String determineBulkInsertionIdentifierGenerationSelectFragment(Dialect dialect) {
37+
throw new IllegalStateException("determineBulkInsertionIdentifierGenerationSelectFragment(...) was not implemented!");
38+
}
39+
40+
/**
41+
* Return the select expression fragment, if any, that generates the identifier values.
42+
*
43+
* @param context A context for SQL string generation.
44+
*
45+
* @return The identifier value generation fragment (SQL). {@code null} indicates that no fragment is needed.
46+
*/
47+
default String determineBulkInsertionIdentifierGenerationSelectFragment(SqlStringGenerationContext context) {
48+
return determineBulkInsertionIdentifierGenerationSelectFragment( context.getDialect() );
49+
}
3650
}

0 commit comments

Comments
 (0)