Hibernate version: 3.2.0 ga
I'm trying to create a Filter on a class via the @FilterDef/@Filter annotations. The Filter uses the "connect by" keyword, i.e. it involves native sql syntax. Everything works fine when I enable the filter and run a native SQL query involving that class. However, it fails when the query is enabled and I run a query using HQL.
Looking at the sql output, it's clearly assuming that the filter clause is HQL and is treating the words "connect" "by" "start" "with" etc as fields. Thus, it tries to append the default table name to them, resulting in raw SQL like
Quote:
TABLE.connect TABLE.by
etc
I guess it makes sense, since the filter clause is probably just being appended as an additional "where" clause before it is converted to raw sql.
Does anyone know if there is a way to get around this without converting all filtered queries to be native SQL? maybe a way to "escape" the filter clause so it somehow get deferred until after the SQL is generated or something?
thanks,
Pete