mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
HHH-16182 - Converted boolean values not always properly handled in predicates
This commit is contained in:
parent
48236e388f
commit
3dc855aa31
@ -12,6 +12,7 @@
|
|||||||
import org.hibernate.boot.model.FunctionContributor;
|
import org.hibernate.boot.model.FunctionContributor;
|
||||||
import org.hibernate.dialect.OracleDialect;
|
import org.hibernate.dialect.OracleDialect;
|
||||||
import org.hibernate.dialect.SQLServerDialect;
|
import org.hibernate.dialect.SQLServerDialect;
|
||||||
|
import org.hibernate.dialect.SybaseASEDialect;
|
||||||
import org.hibernate.dialect.SybaseDialect;
|
import org.hibernate.dialect.SybaseDialect;
|
||||||
import org.hibernate.engine.spi.SessionImplementor;
|
import org.hibernate.engine.spi.SessionImplementor;
|
||||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
@ -329,9 +330,15 @@ private int countByCriteria(String attributeName, boolean matchValue, SessionImp
|
|||||||
return result.intValue();
|
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
|
@Test
|
||||||
@SkipForDialect(dialectClass = OracleDialect.class)
|
@SkipForDialect(dialectClass = OracleDialect.class)
|
||||||
@SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true)
|
@SkipForDialect(dialectClass = SybaseDialect.class)
|
||||||
|
@SkipForDialect(dialectClass = SybaseASEDialect.class)
|
||||||
@SkipForDialect(dialectClass = SQLServerDialect.class)
|
@SkipForDialect(dialectClass = SQLServerDialect.class)
|
||||||
public void testBooleanFunctionAsPredicate(SessionFactoryScope scope) {
|
public void testBooleanFunctionAsPredicate(SessionFactoryScope scope) {
|
||||||
// Not strictly relevant to boolean mappings, but test that boolean
|
// Not strictly relevant to boolean mappings, but test that boolean
|
||||||
@ -348,9 +355,15 @@ public void testBooleanFunctionAsPredicate(SessionFactoryScope scope) {
|
|||||||
assertThat( statementInspector.getSqlQueries().get( 0 ), containsString( "(2=2)" ) );
|
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
|
@Test
|
||||||
@SkipForDialect(dialectClass = OracleDialect.class)
|
@SkipForDialect(dialectClass = OracleDialect.class)
|
||||||
@SkipForDialect(dialectClass = SybaseDialect.class, matchSubTypes = true)
|
@SkipForDialect(dialectClass = SybaseDialect.class)
|
||||||
|
@SkipForDialect(dialectClass = SybaseASEDialect.class)
|
||||||
@SkipForDialect(dialectClass = SQLServerDialect.class)
|
@SkipForDialect(dialectClass = SQLServerDialect.class)
|
||||||
public void testBooleanFunctionInPredicate(SessionFactoryScope scope) {
|
public void testBooleanFunctionInPredicate(SessionFactoryScope scope) {
|
||||||
// Not strictly relevant to boolean mappings, but test that boolean
|
// Not strictly relevant to boolean mappings, but test that boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user