From a03c1c0ef705b4f2d81479f711268bad650d620f Mon Sep 17 00:00:00 2001 From: Jan Schatteman Date: Tue, 10 Oct 2023 17:04:56 +0200 Subject: [PATCH] HHH-17302 - Use nocache for MariaDB sequences Signed-off-by: Jan Schatteman --- .../dialect/sequence/MariaDBSequenceSupport.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/sequence/MariaDBSequenceSupport.java b/hibernate-core/src/main/java/org/hibernate/dialect/sequence/MariaDBSequenceSupport.java index 55ffc4d149..cd8d3291b2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/sequence/MariaDBSequenceSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/sequence/MariaDBSequenceSupport.java @@ -17,6 +17,21 @@ public final class MariaDBSequenceSupport extends ANSISequenceSupport { public static final SequenceSupport INSTANCE = new MariaDBSequenceSupport(); + @Override + public String getCreateSequenceString(String sequenceName) throws MappingException { + return "create sequence " + sequenceName + " nocache"; + } + + @Override + public String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) + throws MappingException { + return "create sequence " + sequenceName + + startingValue( initialValue, incrementSize ) + + " start with " + initialValue + + " increment by " + incrementSize + + " nocache"; + } + @Override public String getSelectSequencePreviousValString(String sequenceName) throws MappingException { return "previous value for " + sequenceName;