HHH-17302 - Use nocache for MariaDB sequences

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2023-10-10 17:04:56 +02:00 committed by Christian Beikov
parent e5b2298b76
commit a03c1c0ef7
1 changed files with 15 additions and 0 deletions

View File

@ -17,6 +17,21 @@ public final class MariaDBSequenceSupport extends ANSISequenceSupport {
public static final SequenceSupport INSTANCE = new MariaDBSequenceSupport(); 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 @Override
public String getSelectSequencePreviousValString(String sequenceName) throws MappingException { public String getSelectSequencePreviousValString(String sequenceName) throws MappingException {
return "previous value for " + sequenceName; return "previous value for " + sequenceName;