HHH-18180 Informix IF EXISTS clauses support
This commit is contained in:
parent
f71a408df8
commit
8d01a705c1
|
@ -93,6 +93,7 @@ public class InformixDialect extends Dialect {
|
||||||
|
|
||||||
private final UniqueDelegate uniqueDelegate;
|
private final UniqueDelegate uniqueDelegate;
|
||||||
private final LimitHandler limitHandler;
|
private final LimitHandler limitHandler;
|
||||||
|
private final SequenceSupport sequenceSupport;
|
||||||
private final StandardForeignKeyExporter foreignKeyExporter = new StandardForeignKeyExporter( this ) {
|
private final StandardForeignKeyExporter foreignKeyExporter = new StandardForeignKeyExporter( this ) {
|
||||||
@Override
|
@Override
|
||||||
public String[] getSqlCreateStrings(
|
public String[] getSqlCreateStrings(
|
||||||
|
@ -137,6 +138,7 @@ public class InformixDialect extends Dialect {
|
||||||
//version 11 and above, parameters are supported
|
//version 11 and above, parameters are supported
|
||||||
//but I have not tested this at all!
|
//but I have not tested this at all!
|
||||||
: new SkipFirstLimitHandler( getVersion().isSameOrAfter( 11 ) );
|
: new SkipFirstLimitHandler( getVersion().isSameOrAfter( 11 ) );
|
||||||
|
sequenceSupport = new InformixSequenceSupport( getVersion().isSameOrAfter( 11, 70 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -399,7 +401,7 @@ public class InformixDialect extends Dialect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SequenceSupport getSequenceSupport() {
|
public SequenceSupport getSequenceSupport() {
|
||||||
return InformixSequenceSupport.INSTANCE;
|
return sequenceSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -417,6 +419,21 @@ public class InformixDialect extends Dialect {
|
||||||
return limitHandler;
|
return limitHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsIfExistsBeforeTableName() {
|
||||||
|
return getVersion().isSameOrAfter( 11, 70 );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsIfExistsBeforeTypeName() {
|
||||||
|
return getVersion().isSameOrAfter( 11, 70 );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsIfExistsBeforeConstraintName() {
|
||||||
|
return getVersion().isSameOrAfter( 11, 70 );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsOrderByInSubquery() {
|
public boolean supportsOrderByInSubquery() {
|
||||||
// This is just a guess
|
// This is just a guess
|
||||||
|
|
|
@ -16,11 +16,19 @@ import org.hibernate.dialect.sequence.SequenceSupport;
|
||||||
*/
|
*/
|
||||||
public final class InformixSequenceSupport extends NextvalSequenceSupport {
|
public final class InformixSequenceSupport extends NextvalSequenceSupport {
|
||||||
|
|
||||||
public static final SequenceSupport INSTANCE = new InformixSequenceSupport();
|
private boolean supportsIfExists = false;
|
||||||
|
|
||||||
|
public InformixSequenceSupport(boolean supportsIfExists){
|
||||||
|
this.supportsIfExists = supportsIfExists;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFromDual() {
|
public String getFromDual() {
|
||||||
return " from informix.systables where tabid=1";
|
return " from informix.systables where tabid=1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDropSequenceString(String sequenceName) {
|
||||||
|
return "drop sequence " + ( supportsIfExists ? "if exists " : "" ) + sequenceName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue