Just based on a guess, I bet this happens in a class named org.hibernate.hql.internal.QuerySplitter. That class has a comment that sums it up pretty well:
//TODO: this is one of the ugliest and most fragile pieces of code in Hibernate....

Its whole job it to find "domain model references" in the query string and "split the query" based on any indicated polymorphism. Long story short, this is the piece of code that allows Hibernate to understand a query like select o from java.lang.Object o.
A side effect of that is that it qualifies (by prepending package) all such references it finds. My guess is that QuerySplitter is not properly understanding that this reference occurs inside quotes and so should not be handled.
|