Hibernate version: 3.0
Mapping documents:i think no matter
Code between sessionFactory.openSession() and session.close(): same
Full stack trace of any exception that occurs:Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 68 [SELECT u FROM ru.mos2.model.UserEntity u WHERE is_match_vector_utf8(a,?)]
(full stack is long)
Name and version of the database you are using:PosgreSQL 8.1
The generated SQL (show_sql=true): NO
Hi all
I need to use TSearch module of PSQL from EJBQL
To do so i extends a dialect
Code:
public class TSPGDialect extends PostgreSQLDialect
writen my function
Code:
public class StringMatchVector_utf8 implements SQLFunction {
...
public Type getReturnType(Type columnType, Mapping mapping) throws QueryException {
return new BooleanType();
}
...
}
and registered it in dialect
Code:
registerFunction("is_match_vector_utf8", new StringMatchVector_utf8())
all goes well after some dubugging function work BUT
if i write
Code:
SELECT u FROM UserEntity u WHERE is_match_vector_utf8(a,?)
i get exception above
if i write
Code:
SELECT u FROM UserEntity u WHERE true = is_match_vector_utf8(a,?)
all works.
I will use second way and be happy but this looks like a bug in QL parser result of a BooleanType function must be valid for where clause.
Thanks for attantion, if it realy looks like a bug lets post in in jira, or maybe some one will correct me.
PS I am russian, sorry for my english.