-->
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: Using match/against
PostPosted: Wed Oct 17, 2007 2:26 pm 
Newbie

Joined: Wed Oct 17, 2007 2:13 pm
Posts: 1
Location: Conselheiro Lafaiete, Brazil
Hi everybody,

I'm facing some problems while trying to use que functions "match/against". I've been looking up for any tip about this, but I still couldn't find any. I've even subclassed MySQLDialect in order to try to register those functions, but it keeps not working.
Any tip?

Thank you in advance.

Felipe.


QUERY:
select distinct(advertisement) from Advertisement advertisement where ( (match(advertisement.text) against('one text')) or (advertisement.categoryCod in (select distinct(category.cod) from Category category where category.name like 'one text%')) or (advertisement.trademarkCod in (select distinct(trademark.cod) from Trademark trademark where trademark.name like 'one text%')) or (advertisement.modelCod in (select distinct(model.cod) from Model model where model.name like 'one text%')) or (advertisement.submodelCod in (select distinct(submodel.cod) from Submodel submodel where submodel.name like 'one text%')) )



STACK TRACE:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: against near line 1, column 139 [ select distinct(advertisement) from com.phf.achaki.dataaccess.db.model.Advertisement advertisement where ( (match(advertisement.text) against('textinho funcionalidade')) or (advertisement.categoryCod in (select distinct(category.cod) from com.phf.achaki.dataaccess.db.model.Category category where category.name like 'textinho funcionalidade%')) or (advertisement.trademarkCod in (select distinct(trademark.cod) from com.phf.achaki.dataaccess.db.model.Trademark trademark where trademark.name like 'textinho funcionalidade%')) or (advertisement.modelCod in (select distinct(model.cod) from com.phf.achaki.dataaccess.db.model.Model model where model.name like 'textinho funcionalidade%')) or (advertisement.submodelCod in (select distinct(submodel.cod) from com.phf.achaki.dataaccess.db.model.Submodel submodel where submodel.name like 'textinho funcionalidade%')) ) ]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.phf.achaki.dataaccess.db.service.AdvertisementService.getPropagandaByText(AdvertisementService.java:755)
at com.phf.achaki.dataaccess.delegate.ServiceDelegate.getPropagandaByText(ServiceDelegate.java:676)
at com.phf.achaki.business.SearchBusiness.setAdvertisementsToShow(SearchBusiness.java:504)
at com.phf.achaki.web.controller.SearchAction.doSearch(SearchAction.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.phf.achaki.web.filter.AuthFilter.doFilter(AuthFilter.java:67)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


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.