Uploaded image for project: 'Hibernate OGM'
  1. OGM-737

[Neo4J] Using embedded object in JPQL and binding a named parameter causes an exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.1.1.Final
    • Fix Version/s: 4.1.2.Final
    • Component/s: query
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      final Query jpqlQuery = em.createQuery("from UserProfile p where p.address.city = :city");
      jpqlQuery.setParameter("city", "test");

      Please find attached project to reproduce the issue.
      Neo4JTest can be used as an entry point

      Exception:
      org.hibernate.MappingException: unknown property: city
      at org.hibernate.persister.entity.AbstractPropertyMapping.getColumnNames(AbstractPropertyMapping.java:89)
      at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyColumnNames(AbstractEntityPersister.java:1982)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jPropertyHelper.getColumnName(Neo4jPropertyHelper.java:84)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jPropertyHelper.getColumnName(Neo4jPropertyHelper.java:75)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.predicate.impl.Neo4jPredicateFactory.columnName(Neo4jPredicateFactory.java:109)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.predicate.impl.Neo4jPredicateFactory.getComparisonPredicate(Neo4jPredicateFactory.java:49)
      at org.hibernate.hql.ast.spi.SingleEntityQueryBuilder.addComparisonPredicate(SingleEntityQueryBuilder.java:87)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jQueryRendererDelegate.addComparisonPredicate(Neo4jQueryRendererDelegate.java:185)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jQueryRendererDelegate.predicateEquals(Neo4jQueryRendererDelegate.java:163)
      at org.hibernate.hql.ast.render.QueryRenderer.predicate(QueryRenderer.java:5197)
      at org.hibernate.hql.ast.render.QueryRenderer.searchCondition(QueryRenderer.java:4871)
      at org.hibernate.hql.ast.render.QueryRenderer.whereClause(QueryRenderer.java:2347)
      at org.hibernate.hql.ast.render.QueryRenderer.querySpec(QueryRenderer.java:2202)
      at org.hibernate.hql.ast.render.QueryRenderer.queryExpression(QueryRenderer.java:2105)
      at org.hibernate.hql.ast.render.QueryRenderer.queryStatement(QueryRenderer.java:1744)
      at org.hibernate.hql.ast.render.QueryRenderer.queryStatementSet(QueryRenderer.java:1657)
      at org.hibernate.hql.ast.render.QueryRenderer.statement(QueryRenderer.java:653)
      at org.hibernate.hql.ast.spi.QueryRendererProcessor.process(QueryRendererProcessor.java:51)
      at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:82)
      at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jBasedQueryParserService.parseQuery(Neo4jBasedQueryParserService.java:40)
      at org.hibernate.ogm.query.impl.OgmQueryTranslator.getLoader(OgmQueryTranslator.java:131)
      at org.hibernate.ogm.query.impl.OgmQueryTranslator.doCompile(OgmQueryTranslator.java:120)
      at org.hibernate.ogm.query.impl.LegacyParserBridgeQueryTranslator.compile(LegacyParserBridgeQueryTranslator.java:55)
      at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:131)
      at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:93)
      at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:167)
      at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301)
      at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236)
      at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1800)
      at org.hibernate.engine.spi.SessionDelegatorBaseImpl.createQuery(SessionDelegatorBaseImpl.java:401)
      at org.hibernate.ogm.jpa.impl.OgmEntityManager.createQuery(OgmEntityManager.java:209)
      at by.defascathibernate.ogm.test.BasicTest.lambda$test5FindJPQL$0(BasicTest.java:67)
      at by.defascathibernate.ogm.test.BasicTest$$Lambda$1/1168232535.accept(Unknown Source)
      at by.defascathibernate.ogm.test.BasicTest.doInTransaction(BasicTest.java:49)
      at by.defascathibernate.ogm.test.BasicTest.test5FindJPQL(BasicTest.java:64)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: