Skip to content

Commit 9f4ebca

Browse files
yrodierebeikov
authored andcommitted
HHH-15069 Fix backwards-incompatible changes for implementors of InsertGeneratedIdentifierDelegate
1 parent 1f4162a commit 9f4ebca

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

hibernate-core/src/main/java/org/hibernate/id/insert/InsertGeneratedIdentifierDelegate.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,28 @@
2222
*/
2323
public interface InsertGeneratedIdentifierDelegate {
2424

25+
/**
26+
* Build a {@link org.hibernate.sql.Insert} specific to the delegate's mode
27+
* of handling generated key values.
28+
*
29+
* @return The insert object.
30+
* @deprecated Implement {@link #prepareIdentifierGeneratingInsert(SqlStringGenerationContext)} instead.
31+
*/
32+
@Deprecated
33+
default IdentifierGeneratingInsert prepareIdentifierGeneratingInsert() {
34+
throw new IllegalStateException("prepareIdentifierGeneratingInsert(...) was not implemented!");
35+
}
36+
2537
/**
2638
* Build a {@link org.hibernate.sql.Insert} specific to the delegate's mode
2739
* of handling generated key values.
2840
*
2941
* @param context A context to help generate SQL strings
3042
* @return The insert object.
3143
*/
32-
IdentifierGeneratingInsert prepareIdentifierGeneratingInsert(SqlStringGenerationContext context);
44+
default IdentifierGeneratingInsert prepareIdentifierGeneratingInsert(SqlStringGenerationContext context) {
45+
return prepareIdentifierGeneratingInsert();
46+
}
3347

3448
/**
3549
* Perform the indicated insert SQL statement and determine the identifier value

0 commit comments

Comments
 (0)