-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: my implementation of boolean SQLFunction
PostPosted: Mon Mar 12, 2007 11:49 am 
Newbie

Joined: Mon Mar 12, 2007 11:30 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.