HHH-16182 - Converted boolean values not always properly handled in predicates

This commit is contained in:
Steve Ebersole 2023-03-02 09:19:00 -06:00
parent 48236e388f
commit 3dc855aa31
1 changed files with 15 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.FunctionContributor;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseASEDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.metamodel.mapping.JdbcMapping;
@ -329,9 +330,15 @@ public class BooleanMappingTests {
return result.intValue();
}
/**
* @implNote Skipped for dialects without support for boolean (predicate) expressions. The test
* is really about handling the SQM function reference anyway; the actual Dialect implementation
* is not standard.
*/
@Test
@SkipForDialect(dialectClass = OracleDialect.class)
@SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true)
@SkipForDialect(dialectClass = SybaseDialect.class)
@SkipForDialect(dialectClass = SybaseASEDialect.class)
@SkipForDialect(dialectClass = SQLServerDialect.class)
public void testBooleanFunctionAsPredicate(SessionFactoryScope scope) {
// Not strictly relevant to boolean mappings, but test that boolean
@ -348,9 +355,15 @@ public class BooleanMappingTests {
assertThat( statementInspector.getSqlQueries().get( 0 ), containsString( "(2=2)" ) );
}
/**
* @implNote Skipped for dialects without support for boolean (predicate) expressions. The test
* is really about handling the SQM function reference anyway; the actual Dialect implementation
* is not standard.
*/
@Test
@SkipForDialect(dialectClass = OracleDialect.class)
@SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true)
@SkipForDialect(dialectClass = SybaseDialect.class)
@SkipForDialect(dialectClass = SybaseASEDialect.class)
@SkipForDialect(dialectClass = SQLServerDialect.class)
public void testBooleanFunctionInPredicate(SessionFactoryScope scope) {
// Not strictly relevant to boolean mappings, but test that boolean