HHH-12111 - Oracle does not support positive/negative initial sequence values for descending/ascending sequences unless MAXVALUE/MINVALUE is defined as well
This commit is contained in:
parent
9b062e4a6b
commit
26041f49e1
|
@ -395,6 +395,39 @@ public class Oracle8iDialect extends Dialect {
|
||||||
return "create sequence " + sequenceName;
|
return "create sequence " + sequenceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) {
|
||||||
|
if ( initialValue < 0 && incrementSize > 0 ) {
|
||||||
|
return
|
||||||
|
String.format(
|
||||||
|
"%s minvalue %d start with %d increment by %d",
|
||||||
|
getCreateSequenceString( sequenceName ),
|
||||||
|
initialValue,
|
||||||
|
initialValue,
|
||||||
|
incrementSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if ( initialValue > 0 && incrementSize < 0 ) {
|
||||||
|
return
|
||||||
|
String.format(
|
||||||
|
"%s maxvalue %d start with %d increment by %d",
|
||||||
|
getCreateSequenceString( sequenceName ),
|
||||||
|
initialValue,
|
||||||
|
initialValue,
|
||||||
|
incrementSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return
|
||||||
|
String.format(
|
||||||
|
"%s start with %d increment by %d",
|
||||||
|
getCreateSequenceString( sequenceName ),
|
||||||
|
initialValue,
|
||||||
|
incrementSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDropSequenceString(String sequenceName) {
|
public String getDropSequenceString(String sequenceName) {
|
||||||
return "drop sequence " + sequenceName;
|
return "drop sequence " + sequenceName;
|
||||||
|
|
Loading…
Reference in New Issue