mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 00:55:16 +00:00
HHH-9038 Fix HSQLDB dialect for non-existing constraints.
This commits relates to https://hibernate.atlassian.net/browse/HHH-7002. It basically removes the explicit constraints dropping, and uses cascading instead. As HSQLDB requires to put CASCADE last, but fortunately accepts IF EXISTS also before tablename, we just put the IF EXISTS *before* the tablename, and CASCADE after it. And there you go.
This commit is contained in:
parent
18561b8dfb
commit
e83691501f
@ -301,8 +301,16 @@ public boolean bindLimitParametersFirst() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note : HSQLDB actually supports [IF EXISTS] before AND after the <tablename>
|
||||||
|
// But as CASCADE has to be AFTER IF EXISTS in case it's after the tablename,
|
||||||
|
// We put the IF EXISTS before the tablename to be able to add CASCADE after.
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsIfExistsAfterTableName() {
|
public boolean supportsIfExistsAfterTableName() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsIfExistsBeforeTableName() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -669,4 +677,15 @@ public String toBooleanValueString(boolean bool) {
|
|||||||
public boolean supportsTupleDistinctCounts() {
|
public boolean supportsTupleDistinctCounts() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not drop constraints explicitly, just do this by cascading instead.
|
||||||
|
@Override
|
||||||
|
public boolean dropConstraints() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCascadeConstraintsString() {
|
||||||
|
return " CASCADE ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user