Ludovic Pollet commented on Bug HHH-4700

The class cast occurs because CaseNode.getDataType requires a SelectExpression.

The following replacement for that method accepts a SqlNode as well and seems to work well.
Its applies to CaseNode and Case2Node classes. It has no effect for HQL requests that are already working.

public Type getDataType()
{
AST ast = getFirstChild().getNextSibling().getFirstChild().getNextSibling();
if (ast instanceof SelectExpression) { return ((SelectExpression)ast).getDataType(); }
if (ast instanceof SqlNode) { return ((SqlNode)ast).getDataType(); }
// case expression has no valid type ?;
return null;
}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira