-->
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: mongodb Unable to query nested entities using JPQL
PostPosted: Wed Nov 23, 2016 5:21 am 
Newbie

Joined: Wed Mar 18, 2015 11:38 am
Posts: 10
Hi,

I am trying to query a mongodb entity. That query has a where that filters a nested object property.

See where sample: "where i.id_ambito = 4 and i.ubicacion.address.municipio.municipio like '%vitoria-gasteiz%'"


And this is the exception: javax.persistence.PersistenceException: org.hibernate.MappingException: unknown property: municipio

I am using

<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-mongodb</artifactId>
<version>4.1.0.Beta8</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Draft-16</version>
</dependency>


Everything went perfectly until now. All querys go smoothly too except this that filters a nested object property.

Any help please? Thanks in advance.

Javier


Top
 Profile  
 
 Post subject: Re: mongodb Unable to query nested entities using JPQL
PostPosted: Mon Nov 28, 2016 9:38 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
It seems there's might be an error in the mapping.
Could you show how you mapped the entities?

In the query, "municipio" is repeated twice, is that correct?

Also, I would recommend to switch to the latest Hibernate OGM: 5.0.3.Final

EDIT: the latest version is 5.0.3.Final


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.