HHH-9605: fix querying a collection of enums

(cherry picked from commit 001b841934)
This commit is contained in:
obr 2015-03-15 20:02:50 +01:00 committed by Steve Ebersole
parent 9bfceca718
commit b48f93af71
1 changed files with 11 additions and 3 deletions

View File

@ -27,15 +27,15 @@ package org.hibernate.hql.internal.ast.tree;
import java.util.ArrayList;
import java.util.List;
import antlr.SemanticException;
import antlr.collections.AST;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.hql.internal.antlr.HqlSqlTokenTypes;
import org.hibernate.hql.internal.antlr.HqlTokenTypes;
import org.hibernate.param.ParameterSpecification;
import org.hibernate.type.Type;
import antlr.SemanticException;
import antlr.collections.AST;
/**
* @author Steve Ebersole
*/
@ -66,6 +66,14 @@ public class InLogicOperatorNode extends BinaryLogicOperatorNode implements Bina
if ( ExpectedTypeAwareNode.class.isAssignableFrom( inListChild.getClass() ) ) {
( (ExpectedTypeAwareNode) inListChild ).setExpectedType( lhsType );
}
// fix for HHH-9605
if ( CollectionFunction.class.isAssignableFrom( inListChild.getClass() ) &&
ExpectedTypeAwareNode.class.isAssignableFrom( lhs.getClass() ) ) {
lhsType = ((CollectionFunction) inListChild).getDataType();
((ExpectedTypeAwareNode) lhs).setExpectedType( lhsType );
}
inListChild = inListChild.getNextSibling();
}
}