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;
}
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;
}