Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Enum literals not working so well in queries
PostPosted: Mon May 15, 2017 10:00 am 
Newbie

Joined: Thu Jan 05, 2017 1:47 pm
Posts: 16
We have a query:

Code:
select f from equipment_Equipment f where f.type=com.nokia.nspos.model.domain.equipment.types.EquipmentType.port


that is failing with:

Code:
Caused by: org.hibernate.QueryException: could not resolve property: com of: com.nokia.nspos.model.domain.equipment.entities.Equipment
                at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:62) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:56) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyType(AbstractEntityPersister.java:4566) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.ogm.query.parsing.impl.ParserPropertyHelper.getPropertyType(ParserPropertyHelper.java:82) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.query.parsing.impl.ParserPropertyHelper.convertToPropertyType(ParserPropertyHelper.java:48) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jQueryRendererDelegate.fromNamedQuery(Neo4jQueryRendererDelegate.java:422) ~[hibernate-ogm-neo4j-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jQueryRendererDelegate.addComparisonPredicate(Neo4jQueryRendererDelegate.java:370) ~[hibernate-ogm-neo4j-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jQueryRendererDelegate.predicateEquals(Neo4jQueryRendererDelegate.java:349) ~[hibernate-ogm-neo4j-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.predicate(QueryRenderer.java:5238) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.searchCondition(QueryRenderer.java:4912) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.whereClause(QueryRenderer.java:2376) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.querySpec(QueryRenderer.java:2229) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.queryExpression(QueryRenderer.java:2132) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.queryStatement(QueryRenderer.java:1771) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.queryStatementSet(QueryRenderer.java:1684) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.render.QueryRenderer.statement(QueryRenderer.java:680) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.ast.spi.QueryRendererProcessor.process(QueryRendererProcessor.java:51) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.hql.QueryParser.parseQuery(QueryParser.java:82) ~[hibernate-hql-parser-1.4.0.Final.jar:1.4.0.Final]
                at org.hibernate.ogm.datastore.neo4j.query.parsing.impl.Neo4jBasedQueryParserService.parseQuery(Neo4jBasedQueryParserService.java:40) ~[hibernate-ogm-neo4j-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.query.impl.OgmQueryTranslator.getLoader(OgmQueryTranslator.java:135) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.query.impl.OgmQueryTranslator.doCompile(OgmQueryTranslator.java:122) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.ogm.query.impl.LegacyParserBridgeQueryTranslator.compile(LegacyParserBridgeQueryTranslator.java:55) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.engine.spi.SessionDelegatorBaseImpl.createQuery(SessionDelegatorBaseImpl.java:369) ~[hibernate-core-5.1.4.Final.jar:5.1.4.Final]
                at org.hibernate.ogm.jpa.impl.OgmEntityManager.createQuery(OgmEntityManager.java:207) ~[hibernate-ogm-core-5.1.0.Final.jar:5.1.0.Final]
                at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source) ~[na:na]
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
                at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
                at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344) ~[spring-orm-4.2.8.RELEASE.jar:4.2.8.RELEASE]
                at com.sun.proxy.$Proxy202.createQuery(Unknown Source) ~[na:na]
                at com.nokia.nspos.persistence.impl.rest.RestQueryHandler.lambda$query$1(RestQueryHandler.java:67) ~[nspos-persistence-fw-17.9.0-rel.15.jar:17.9.0-rel.15]
                at com.nokia.nspos.persistence.impl.rest.RestQueryHandler$$Lambda$398/140230941.apply(Unknown Source) ~[na:na]
                at com.nokia.nspos.persistence.impl.db.transaction.Transactor.call(Transactor.java:91) ~[nspos-persistence-fw-17.9.0-rel.15.jar:17.9.0-rel.15]
                ... 42 common frames omitted


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.