org.hibernate.hql.ParsingException: HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and p.logout>:logentrytime OR p.logout IS NULL is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression]: line 1:144 state 0 (decision=51) no viable alt; token=[@51,144:147='NULL',<75>,1:144]].

Stack Overflow | Vinod | 5 months ago
  1. 0

    I am using Hibernate OGM 5.0.1 with MongoDB 3.2.6. My JPA QL is below: String checkquery = "SELECT p FROM pppoe_test p where p.sourceIP=:source_ip and p.login>:logentrytime and (p.logout>:logentrytime OR p.logout IS NULL)"; I get an error like: no viable alternative at input 'NULL' HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and (p.logout>:logentrytime OR p.logout IS NULL) is not valid Exception in thread "main" org.hibernate.hql.ParsingException: HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and p.logout>:logentrytime OR p.logout IS NULL is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression]: line 1:144 state 0 (decision=51) no viable alt; token=[@51,144:147='NULL',<75>,1:144]]. at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:70) at org.hibernate.ogm.datastore.mongodb.query.parsing.impl.MongoDBBasedQueryParserService.parseQuery(MongoDBBasedQueryParserService.java:40) at org.hibernate.ogm.query.impl.OgmQueryTranslator.getQuery(OgmQueryTranslator.java:169) at org.hibernate.ogm.query.impl.OgmQueryTranslator.getLoader(OgmQueryTranslator.java:134) at org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:128) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483) Here is the mongodb doc, that I had earlier inserted via the OGM. { "_id" : "cc88a708-c222-4e52-b151-c0f40556b27e", "connectionTimeInSeconds" : NumberLong(100), "location" : "MyCastle", "datatransferIn" : NumberLong(7777777), "sourceIP" : "172.168.10.123", "packetsOut" : NumberLong(33333), "login" : ISODate("2016-07-09T20:45:36.492Z"), "logout" : null, "user" : "dvinod@xyz.com", "packetsIn" : NumberLong(22222), "datatransferOut" : NumberLong(5555555) } I do have the attributes setup properly in the entity @Entity (name="pppoe_test") public class PPPoESession { ... @Temporal(TemporalType.TIMESTAMP) private Date logout; @Basic(optional = false) private String user; @Basic(optional = false) private String sourceIP;

    Hibernate JIRA | 5 months ago | Vinod Kumar Devi
    org.hibernate.hql.ParsingException: HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and p.logout>:logentrytime OR p.logout IS NULL is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression]: line 1:144 state 0 (decision=51) no viable alt; token=[@51,144:147='NULL',<75>,1:144]].
  2. 0

    JPA QL issue with IS NULL filter for MongoDB in Hibernate OGM

    Stack Overflow | 5 months ago | Vinod
    org.hibernate.hql.ParsingException: HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and p.logout>:logentrytime OR p.logout IS NULL is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression]: line 1:144 state 0 (decision=51) no viable alt; token=[@51,144:147='NULL',<75>,1:144]].
  3. 0

    Infinispan-dsl-cache translator: Exception is thrown when order by clause is used

    https://bugzilla.redhat.com/bugzilla/ | 1 year ago | Filip Elias
    org.hibernate.hql.ParsingException: HQLPARSER000002: The query FROM org.jboss.qe.jdg_remote.protobuf.SmallA _gen0 WHERE _gen0.intKey > 1 ORDER BY _gen0.null ASC is not valid; Parser error messages: [[statement, statementElement, selectStatement, orderByClause, sortSpecification, sortKey, concatenation, additiveExpression, multiplyExpression, unaryExpression, atom, identPrimary]: line 1:89 mismatched token: [@32,89:92='null',<124>,1:89]; expecting type IDENTIFIER].
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Infinispan Hibernate search exception: org.hibernate.hql.ParsingException: HQLLUCN000003

    Stack Overflow | 3 years ago | user432024
    org.hibernate.hql.ParsingException: HQLLUCN000003: No queries can be applied to property ABC in type com.xxx.model.MyModel since the property is analyzed.
  6. 0

    Infinispan Hibernate search :org.hibernate.hql.ParsingException: HQLLUCN000003

    Stack Overflow | 3 years ago | Stephan
    org.hibernate.hql.ParsingException: HQLLUCN000003: No queries can be applied to property normVal in type org.cismef.db.core.object.DatatypeProperty since the property is analyzed.

    Root Cause Analysis

    1. org.hibernate.hql.ParsingException

      HQL000002: The query SELECT p FROM PPPoESession p where p.sourceIP=:source_ip and p.login>:logentrytime and p.logout>:logentrytime OR p.logout IS NULL is not valid; Parser error messages: [[statement, statementElement, selectStatement, queryExpression, querySpec, whereClause, logicalExpression, expression, logicalOrExpression, logicalAndExpression, negatedExpression, equalityExpression]: line 1:144 state 0 (decision=51) no viable alt; token=[@51,144:147='NULL',<75>,1:144]].

      at org.hibernate.hql.QueryParser.parseQuery()
    2. Hibernate HQL/JP-QL Parser
      QueryParser.parseQuery
      1. org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:70)
      1 frame
    3. org.hibernate.ogm
      MongoDBBasedQueryParserService.parseQuery
      1. org.hibernate.ogm.datastore.mongodb.query.parsing.impl.MongoDBBasedQueryParserService.parseQuery(MongoDBBasedQueryParserService.java:40)
      1 frame
    4. Hibernate Object Grid Mapper
      OgmQueryTranslator.list
      1. org.hibernate.ogm.query.impl.OgmQueryTranslator.getQuery(OgmQueryTranslator.java:169)
      2. org.hibernate.ogm.query.impl.OgmQueryTranslator.getLoader(OgmQueryTranslator.java:134)
      3. org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:128)
      3 frames
    5. Hibernate
      QueryImpl.list
      1. org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
      2. org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)
      3. org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
      3 frames
    6. org.hibernate.jpa
      QueryImpl.getResultList
      1. org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
      2. org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
      2 frames