According to JSR 338, 4.4.9 Downcasting: "The use of the TREAT operator is supported for downcasting within path expressions in the FROM and WHERE clauses."
I think that Hibernate should actually throw an exception in this case.