-->
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.  [ 2 posts ] 
Author Message
 Post subject: 'LIKE' query operator not well supported in Neo4j
PostPosted: Thu Feb 16, 2017 3:32 pm 
Beginner
Beginner

Joined: Thu Jan 05, 2017 1:47 pm
Posts: 27
I've encountered a couple problems trying to use the LIKE operator.

1) It doesn't work when the pattern is a query parameter. The error happened with it tried to cast a Neo4jQueryParameter to a String on the last line of Neo4jQueryRendererDelegate.predicateLike(). I no longer have the exception trace for that though.

2) The ESCAPE clause doesn't seem to work - after the core Hibernate code parses the query successfully, I get the following exception:

Caused by: org.hibernate.hql.ParsingException: HQL000002: The query SELECT e FROM com.nokia.nspos.model.domain.mock.entities.MockEntity e WHERE (mockString LIKE 'i' ESCAPE '\') is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression, relationalExpression, concatenation, additiveExpression, multiplyExpression, unaryExpression, atom, expressionOrVector, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression, relationalExpression, likeEscape, concatenation, additiveExpression, multiplyExpression, unaryExpression]: line 1:108 state 0 (decision=68) no viable alt; token=[@35,108:108='<EOF>',<-1>,1:108], [statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression, relationalExpression, concatenation, additiveExpression, multiplyExpression, unaryExpression, atom]: line 1:108 mismatched token: [@35,108:108='<EOF>',<-1>,1:108]; expecting type RIGHT_PAREN].
at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:70)
at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jBasedQueryParserService.parseQuery(Neo4jBasedQueryParserService.java:40)
at org.hibernate.ogm.query.impl.OgmQueryTranslator.getLoader(OgmQueryTranslator.java:135)
at org.hibernate.ogm.query.impl.OgmQueryTranslator.doCompile(OgmQueryTranslator.java:122)
at org.hibernate.ogm.query.impl.LegacyParserBridgeQueryTranslator.compile(LegacyParserBridgeQueryTranslator.java:55)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150)
at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240)
at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907)
at org.hibernate.engine.spi.SessionDelegatorBaseImpl.createQuery(SessionDelegatorBaseImpl.java:369)
at org.hibernate.ogm.jpa.impl.OgmEntityManager.createQuery(OgmEntityManager.java:246)


Top
 Profile  
 
 Post subject: Re: 'LIKE' query operator not well supported in Neo4j
PostPosted: Thu Feb 16, 2017 3:37 pm 
Beginner
Beginner

Joined: Thu Jan 05, 2017 1:47 pm
Posts: 27
Sorry about the double post. Network problems, I think. Feel free to delete this one if you can.


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

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.